mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
Content variant ErasedLambda
This commit is contained in:
parent
c459757062
commit
6e5a308557
20 changed files with 147 additions and 93 deletions
|
@ -9838,6 +9838,7 @@ pub fn find_lambda_sets_help(
|
|||
stack.extend(subs.variables[subs_slice.indices()].iter());
|
||||
}
|
||||
}
|
||||
Content::ErasedLambda => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -523,6 +523,7 @@ impl<'a> RawFunctionLayout<'a> {
|
|||
LambdaSet(_) => {
|
||||
internal_error!("lambda set should only appear under a function, where it's handled independently.");
|
||||
}
|
||||
ErasedLambda => internal_error!("erased lambda type should only appear under a function, where it's handled independently"),
|
||||
Structure(flat_type) => Self::layout_from_flat_type(env, flat_type),
|
||||
RangedNumber(..) => Layout::new_help(env, var, content).then(Self::ZeroArgumentThunk),
|
||||
|
||||
|
@ -2128,7 +2129,8 @@ fn lambda_set_size(subs: &Subs, var: Variable) -> (usize, usize, usize) {
|
|||
| Content::FlexAbleVar(_, _)
|
||||
| Content::RigidAbleVar(_, _)
|
||||
| Content::RangedNumber(_)
|
||||
| Content::Error => {}
|
||||
| Content::Error
|
||||
| Content::ErasedLambda => {}
|
||||
}
|
||||
}
|
||||
(max_depth_any_ctor, max_depth_only_lset, total)
|
||||
|
@ -2408,6 +2410,9 @@ impl<'a> Layout<'a> {
|
|||
LambdaSet(_) => {
|
||||
internal_error!("lambda set should only appear under a function, where it's handled independently.");
|
||||
}
|
||||
ErasedLambda => {
|
||||
internal_error!("erased lambda type should only appear under a function, where it's handled independently.");
|
||||
}
|
||||
Structure(flat_type) => layout_from_flat_type(env, flat_type),
|
||||
|
||||
Alias(symbol, _args, actual_var, _) => {
|
||||
|
@ -4456,7 +4461,7 @@ fn layout_from_num_content<'a>(
|
|||
Alias(_, _, _, _) => {
|
||||
todo!("TODO recursively resolve type aliases in num_from_content");
|
||||
}
|
||||
Structure(_) | RangedNumber(..) | LambdaSet(_) => {
|
||||
Structure(_) | RangedNumber(..) | LambdaSet(_) | ErasedLambda => {
|
||||
panic!("Invalid Num.Num type application: {content:?}");
|
||||
}
|
||||
Error => Err(LayoutProblem::Erroneous),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue