mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +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,
|
wrapped: Wrapped::SingleElementRecord,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
// debug_assert!(*index == 0);
|
|
||||||
// load_symbol(env, scope, structure)
|
|
||||||
|
|
||||||
match load_symbol_and_layout(env, scope, structure) {
|
match load_symbol_and_layout(env, scope, structure) {
|
||||||
(StructValue(argument), Layout::Struct(fields)) if fields.len() > 1 => env
|
(StructValue(argument), Layout::Struct(fields)) if fields.len() > 1 =>
|
||||||
.builder
|
// TODO so sometimes a value gets Wrapped::SingleElementRecord
|
||||||
|
// but still has multiple fields...
|
||||||
|
{
|
||||||
|
env.builder
|
||||||
.build_extract_value(
|
.build_extract_value(
|
||||||
argument,
|
argument,
|
||||||
*index as u32,
|
*index as u32,
|
||||||
env.arena.alloc(format!("struct_field_access_{}_", index)),
|
env.arena.alloc(format!("struct_field_access_{}_", index)),
|
||||||
)
|
)
|
||||||
.unwrap(),
|
.unwrap()
|
||||||
(other, _) => {
|
|
||||||
// unreachable!("somehow this is not actually a record/struct? {:?}", other)
|
|
||||||
other
|
|
||||||
}
|
}
|
||||||
|
(other, _) => other,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -615,10 +613,7 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
|
||||||
env.arena.alloc(format!("struct_field_access_{}_", index)),
|
env.arena.alloc(format!("struct_field_access_{}_", index)),
|
||||||
)
|
)
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
(other, _) => {
|
(other, _) => unreachable!("can only index into struct layout", other),
|
||||||
// unreachable!("somehow this is not actually a record/struct? {:?}", other)
|
|
||||||
other
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue