mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-19 03:20:14 +00:00
Avoid over-eager disjoint variable merging during lambda set compaction
During the unspecialized lambda set compaction procedure, we might end up trying to merge too many disjoint variables during unspecialized lambda unification. Avoid doing so, by checking if we're in the compaction procedure.
This commit is contained in:
parent
bda52b0d39
commit
ff4b5f58ab
3 changed files with 62 additions and 10 deletions
|
@ -579,9 +579,13 @@ fn compact_lambda_set<P: Phase>(
|
|||
|
||||
// 3. Unify `t_f1 ~ t_f2`.
|
||||
trace_compact!(3iter_start. subs, this_lambda_set, t_f1, t_f2);
|
||||
let (vars, new_obligations, new_lambda_sets_to_specialize, _meta) =
|
||||
unify(&mut UEnv::new(subs), t_f1, t_f2, Mode::EQ)
|
||||
.expect_success("ambient functions don't unify");
|
||||
let (vars, new_obligations, new_lambda_sets_to_specialize, _meta) = unify(
|
||||
&mut UEnv::new(subs),
|
||||
t_f1,
|
||||
t_f2,
|
||||
Mode::LAMBDA_SET_SPECIALIZATION,
|
||||
)
|
||||
.expect_success("ambient functions don't unify");
|
||||
trace_compact!(3iter_end. subs, t_f1);
|
||||
|
||||
introduce(subs, target_rank, pools, &vars);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue