Unify call's fx var with that of the enclosing function

This commit is contained in:
Agus Zubiaga 2024-10-07 21:14:08 -03:00
parent 7871ba182d
commit 5a5abe3bc5
No known key found for this signature in database
23 changed files with 246 additions and 41 deletions

View file

@ -559,6 +559,34 @@ fn solve(
}
}
}
CallFx(env_call_fx, call_fx_var) => {
match unify(
&mut env.uenv(),
*env_call_fx,
*call_fx_var,
UnificationMode::EQ,
Polarity::OF_VALUE,
) {
Success {
vars,
must_implement_ability,
lambda_sets_to_specialize,
extra_metadata: _,
} => {
env.introduce(rank, &vars);
debug_assert!(must_implement_ability.is_empty());
debug_assert!(lambda_sets_to_specialize.is_empty());
}
Failure(vars, _actual_type, _exected_type, _bad_impls) => {
env.introduce(rank, &vars);
todo!("[purity-inference] can this actually happen?");
}
}
state
}
Store(source_index, target, _filename, _linenr) => {
// a special version of Eq that is used to store types in the AST.
// IT DOES NOT REPORT ERRORS!
@ -2429,6 +2457,8 @@ fn adjust_rank_content(
ErasedLambda => group_rank,
Pure | Effectful => group_rank,
RangedNumber(_) => group_rank,
}
}