mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Add Layout::Erased
This commit is contained in:
parent
283b9d53d6
commit
7ea85e44d2
18 changed files with 58 additions and 14 deletions
|
@ -39,6 +39,7 @@ pub fn eq_generic<'a>(
|
|||
Union(union_layout) => eq_tag_union(root, ident_ids, ctx, layout_interner, union_layout),
|
||||
Ptr(inner_layout) => eq_boxed(root, ident_ids, ctx, layout_interner, inner_layout),
|
||||
LambdaSet(_) => unreachable!("`==` is not defined on functions"),
|
||||
Erased(_) => unreachable!("`==` is not defined on erased types"),
|
||||
RecursivePointer(_) => {
|
||||
unreachable!(
|
||||
"Can't perform `==` on RecursivePointer. Should have been replaced by a tag union."
|
||||
|
|
|
@ -584,6 +584,8 @@ impl<'a> CodeGenHelp<'a> {
|
|||
LayoutRepr::RecursivePointer(_) => LayoutRepr::Union(ctx.recursive_union.unwrap()),
|
||||
|
||||
LayoutRepr::FunctionPointer(_) => return layout,
|
||||
|
||||
LayoutRepr::Erased(_) => return layout,
|
||||
};
|
||||
|
||||
layout_interner.insert(Layout::new(LayoutWrapper::Direct(repr), semantic))
|
||||
|
@ -841,5 +843,6 @@ fn layout_needs_helper_proc<'a>(
|
|||
LayoutRepr::RecursivePointer(_) => false,
|
||||
LayoutRepr::Ptr(_) => false,
|
||||
LayoutRepr::FunctionPointer(_) => false,
|
||||
LayoutRepr::Erased(_) => true,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
use bumpalo::collections::vec::Vec;
|
||||
use bumpalo::collections::CollectIn;
|
||||
use roc_error_macros::todo_lambda_erasure;
|
||||
use roc_module::low_level::{LowLevel, LowLevel::*};
|
||||
use roc_module::symbol::{IdentIds, Symbol};
|
||||
use roc_target::PtrWidth;
|
||||
|
@ -231,6 +232,9 @@ pub fn refcount_generic<'a>(
|
|||
structure,
|
||||
)
|
||||
}
|
||||
LayoutRepr::Erased(_) => {
|
||||
todo_lambda_erasure!()
|
||||
}
|
||||
LayoutRepr::RecursivePointer(_) => unreachable!(
|
||||
"We should never call a refcounting helper on a RecursivePointer layout directly"
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue