mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
make is_primitive look through LambdaSet
This commit is contained in:
parent
4b31c77b37
commit
89201676ef
1 changed files with 12 additions and 3 deletions
|
@ -552,7 +552,7 @@ impl<
|
|||
self.allocation_map.insert(*sym, owned_data);
|
||||
self.symbol_storage_map.insert(
|
||||
*sym,
|
||||
Stack(if is_primitive(layout) {
|
||||
Stack(if is_primitive(layout_interner, layout) {
|
||||
ReferencedPrimitive {
|
||||
base_offset: data_offset,
|
||||
size,
|
||||
|
@ -1400,6 +1400,15 @@ impl<
|
|||
}
|
||||
}
|
||||
|
||||
fn is_primitive(layout: InLayout<'_>) -> bool {
|
||||
matches!(layout, single_register_layouts!())
|
||||
fn is_primitive(layout_interner: &mut STLayoutInterner<'_>, layout: InLayout<'_>) -> bool {
|
||||
match layout {
|
||||
single_register_layouts!() => true,
|
||||
_ => match layout_interner.get(layout) {
|
||||
Layout::Boxed(_) => true,
|
||||
Layout::LambdaSet(lambda_set) => {
|
||||
is_primitive(layout_interner, lambda_set.runtime_representation())
|
||||
}
|
||||
_ => false,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue