mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Convert LayoutRepr::Struct into a tuple variant
This commit is contained in:
parent
a6bda6eccf
commit
a67c148be7
24 changed files with 85 additions and 128 deletions
|
@ -2261,16 +2261,15 @@ impl<
|
|||
.storage_manager
|
||||
.claim_stack_area(dst, self.layout_interner.stack_size(*ret_layout));
|
||||
|
||||
let ret_fields = if let LayoutRepr::Struct { field_layouts, .. } =
|
||||
self.layout_interner.get(*ret_layout).repr
|
||||
{
|
||||
field_layouts
|
||||
} else {
|
||||
internal_error!(
|
||||
"Expected replace to return a struct instead found: {:?}",
|
||||
ret_layout
|
||||
)
|
||||
};
|
||||
let ret_fields =
|
||||
if let LayoutRepr::Struct(field_layouts) = self.layout_interner.get(*ret_layout).repr {
|
||||
field_layouts
|
||||
} else {
|
||||
internal_error!(
|
||||
"Expected replace to return a struct instead found: {:?}",
|
||||
ret_layout
|
||||
)
|
||||
};
|
||||
|
||||
// Only return list and old element.
|
||||
debug_assert_eq!(ret_fields.len(), 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue