Content variant ErasedLambda

This commit is contained in:
Ayaz Hafiz 2023-06-23 15:53:08 -05:00
parent c459757062
commit 6e5a308557
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
20 changed files with 147 additions and 93 deletions

View file

@ -9838,6 +9838,7 @@ pub fn find_lambda_sets_help(
stack.extend(subs.variables[subs_slice.indices()].iter());
}
}
Content::ErasedLambda => {}
}
}

View file

@ -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),