Generate code for recursive nullable wrapped lambda sets

This commit is contained in:
Ayaz Hafiz 2023-03-27 10:10:15 -05:00
parent 0f73c25c0c
commit 3f532df981
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
5 changed files with 246 additions and 2 deletions

View file

@ -1621,11 +1621,27 @@ impl<'a> LambdaSet<'a> {
union_layout: union,
}
}
UnionLayout::NonNullableUnwrapped(_) => todo!("recursive closures"),
UnionLayout::NullableWrapped {
nullable_id: _,
other_tags: _,
} => todo!("recursive closures"),
} => {
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(_) => internal_error!("I thought a non-nullable-unwrapped variant for a lambda set was impossible: how could such a lambda set be created without a base case?"),
}
}
Layout::Struct { .. } => {