mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
clear up comments
This commit is contained in:
parent
f857203673
commit
30c897219b
1 changed files with 13 additions and 18 deletions
|
@ -580,22 +580,20 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
|
|||
wrapped: Wrapped::SingleElementRecord,
|
||||
..
|
||||
} => {
|
||||
// debug_assert!(*index == 0);
|
||||
// load_symbol(env, scope, structure)
|
||||
|
||||
match load_symbol_and_layout(env, scope, structure) {
|
||||
(StructValue(argument), Layout::Struct(fields)) if fields.len() > 1 => env
|
||||
.builder
|
||||
.build_extract_value(
|
||||
argument,
|
||||
*index as u32,
|
||||
env.arena.alloc(format!("struct_field_access_{}_", index)),
|
||||
)
|
||||
.unwrap(),
|
||||
(other, _) => {
|
||||
// unreachable!("somehow this is not actually a record/struct? {:?}", other)
|
||||
other
|
||||
(StructValue(argument), Layout::Struct(fields)) if fields.len() > 1 =>
|
||||
// TODO so sometimes a value gets Wrapped::SingleElementRecord
|
||||
// but still has multiple fields...
|
||||
{
|
||||
env.builder
|
||||
.build_extract_value(
|
||||
argument,
|
||||
*index as u32,
|
||||
env.arena.alloc(format!("struct_field_access_{}_", index)),
|
||||
)
|
||||
.unwrap()
|
||||
}
|
||||
(other, _) => other,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -615,10 +613,7 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
|
|||
env.arena.alloc(format!("struct_field_access_{}_", index)),
|
||||
)
|
||||
.unwrap(),
|
||||
(other, _) => {
|
||||
// unreachable!("somehow this is not actually a record/struct? {:?}", other)
|
||||
other
|
||||
}
|
||||
(other, _) => unreachable!("can only index into struct layout", other),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue