mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
unwrap lamda set to runtime representation
This commit is contained in:
parent
9e2051670f
commit
f7e3254a35
2 changed files with 17 additions and 8 deletions
|
@ -654,7 +654,15 @@ impl<
|
|||
}
|
||||
let base_offset = self.claim_stack_area(sym, struct_size);
|
||||
|
||||
if let Layout::Struct { field_layouts, .. } = layout_interner.get(*layout) {
|
||||
let mut in_layout = *layout;
|
||||
let layout = loop {
|
||||
match layout_interner.get(in_layout) {
|
||||
Layout::LambdaSet(inner) => in_layout = inner.runtime_representation(),
|
||||
other => break other,
|
||||
}
|
||||
};
|
||||
|
||||
if let Layout::Struct { field_layouts, .. } = layout {
|
||||
let mut current_offset = base_offset;
|
||||
for (field, field_layout) in fields.iter().zip(field_layouts.iter()) {
|
||||
self.copy_symbol_to_stack_offset(
|
||||
|
@ -669,8 +677,15 @@ impl<
|
|||
}
|
||||
} else {
|
||||
// This is a single element struct. Just copy the single field to the stack.
|
||||
dbg!(&fields);
|
||||
debug_assert_eq!(fields.len(), 1);
|
||||
self.copy_symbol_to_stack_offset(layout_interner, buf, base_offset, &fields[0], layout);
|
||||
self.copy_symbol_to_stack_offset(
|
||||
layout_interner,
|
||||
buf,
|
||||
base_offset,
|
||||
&fields[0],
|
||||
&in_layout,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -333,12 +333,6 @@ trait Backend<'a> {
|
|||
ret_layout,
|
||||
..
|
||||
} => {
|
||||
dbg!(
|
||||
func_sym,
|
||||
func_sym.name() == Symbol::BOOL_TRUE,
|
||||
func_sym.name().is_builtin()
|
||||
);
|
||||
|
||||
if let LowLevelWrapperType::CanBeReplacedBy(lowlevel) =
|
||||
LowLevelWrapperType::from_symbol(func_sym.name())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue