mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-12 23:06:18 +00:00
Unify call's fx var with that of the enclosing function
This commit is contained in:
parent
7871ba182d
commit
5a5abe3bc5
23 changed files with 246 additions and 41 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue