mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Build member layouts for recursive lambda sets
This commit is contained in:
parent
a4bb6879bc
commit
ba2768c9b0
1 changed files with 17 additions and 1 deletions
|
@ -910,7 +910,23 @@ impl<'a> LambdaSet<'a> {
|
|||
union_layout: *union,
|
||||
}
|
||||
}
|
||||
UnionLayout::Recursive(_) => todo!("recursive closures"),
|
||||
UnionLayout::Recursive(_) => {
|
||||
let (index, (name, fields)) = self
|
||||
.set
|
||||
.iter()
|
||||
.enumerate()
|
||||
.find(|(_, (s, layouts))| comparator(*s, layouts))
|
||||
.unwrap();
|
||||
|
||||
let closure_name = *name;
|
||||
|
||||
ClosureRepresentation::Union {
|
||||
tag_id: index as TagIdIntType,
|
||||
alphabetic_order_fields: fields,
|
||||
closure_name,
|
||||
union_layout: *union,
|
||||
}
|
||||
}
|
||||
UnionLayout::NonNullableUnwrapped(_) => todo!("recursive closures"),
|
||||
UnionLayout::NullableWrapped {
|
||||
nullable_id: _,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue