mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
fix comment
This commit is contained in:
parent
e80f8a5114
commit
6890193917
1 changed files with 8 additions and 11 deletions
|
@ -1423,14 +1423,8 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
|
|||
Reuse { .. } => todo!(),
|
||||
|
||||
StructAtIndex {
|
||||
index,
|
||||
structure,
|
||||
field_layouts,
|
||||
index, structure, ..
|
||||
} => {
|
||||
// if you hit this: we unwrap 1-element records, so instead of `x = StructAtIndex 0 y`
|
||||
// you should substitute `x` with `y` in the remainder of the statement
|
||||
debug_assert!(field_layouts.len() > 1, "one-element records are unwrapped");
|
||||
|
||||
// extract field from a record
|
||||
match load_symbol_and_layout(scope, structure) {
|
||||
(StructValue(argument), Layout::Struct(fields)) => {
|
||||
|
@ -1479,10 +1473,13 @@ pub fn build_exp_expr<'a, 'ctx, 'env>(
|
|||
|
||||
env.builder.build_load(ptr, "load_rosetree_like")
|
||||
}
|
||||
(other, layout) => unreachable!(
|
||||
(other, layout) => {
|
||||
// potential cause: indexing into an unwrapped 1-element record/tag?
|
||||
unreachable!(
|
||||
"can only index into struct layout\nValue: {:?}\nLayout: {:?}\nIndex: {:?}",
|
||||
other, layout, index
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue