mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
fix one element struct unpacking
I think this broke when we decided that we want to not drop empty fields from layouts?
This commit is contained in:
parent
ef89ff15a1
commit
df8ab829a6
4 changed files with 33 additions and 17 deletions
|
@ -1013,6 +1013,8 @@ fn path_to_expr_help<'a>(
|
|||
|
||||
debug_assert!(*index < field_layouts.len() as u64);
|
||||
|
||||
debug_assert_eq!(field_layouts.len(), 1);
|
||||
|
||||
let inner_layout = field_layouts[*index as usize].clone();
|
||||
let inner_expr = Expr::AccessAtIndex {
|
||||
index: *index,
|
||||
|
|
|
@ -3255,7 +3255,10 @@ pub fn with_hole<'a>(
|
|||
|
||||
match Wrapped::opt_from_layout(&record_layout) {
|
||||
Some(result) => result,
|
||||
None => Wrapped::SingleElementRecord,
|
||||
None => {
|
||||
debug_assert_eq!(field_layouts.len(), 1);
|
||||
Wrapped::SingleElementRecord
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue