mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-23 14:35:12 +00:00
Cover mode when unifying variable slices
This commit is contained in:
parent
08d04e8c79
commit
a58d128d9e
1 changed files with 4 additions and 3 deletions
|
@ -2788,7 +2788,7 @@ fn unify_flat_type<M: MetaCollector>(
|
||||||
}
|
}
|
||||||
|
|
||||||
(Apply(l_symbol, l_args), Apply(r_symbol, r_args)) if l_symbol == r_symbol => {
|
(Apply(l_symbol, l_args), Apply(r_symbol, r_args)) if l_symbol == r_symbol => {
|
||||||
let mut outcome = unify_zip_slices(env, pool, *l_args, *r_args);
|
let mut outcome = unify_zip_slices(env, pool, *l_args, *r_args, ctx.mode);
|
||||||
|
|
||||||
if outcome.mismatches.is_empty() {
|
if outcome.mismatches.is_empty() {
|
||||||
outcome.union(merge(env, ctx, Structure(Apply(*r_symbol, *r_args))));
|
outcome.union(merge(env, ctx, Structure(Apply(*r_symbol, *r_args))));
|
||||||
|
@ -2799,7 +2799,7 @@ fn unify_flat_type<M: MetaCollector>(
|
||||||
(Func(l_args, l_closure, l_ret), Func(r_args, r_closure, r_ret))
|
(Func(l_args, l_closure, l_ret), Func(r_args, r_closure, r_ret))
|
||||||
if l_args.len() == r_args.len() =>
|
if l_args.len() == r_args.len() =>
|
||||||
{
|
{
|
||||||
let arg_outcome = unify_zip_slices(env, pool, *l_args, *r_args);
|
let arg_outcome = unify_zip_slices(env, pool, *l_args, *r_args, ctx.mode);
|
||||||
let ret_outcome = unify_pool(env, pool, *l_ret, *r_ret, ctx.mode);
|
let ret_outcome = unify_pool(env, pool, *l_ret, *r_ret, ctx.mode);
|
||||||
let closure_outcome = unify_pool(env, pool, *l_closure, *r_closure, ctx.mode);
|
let closure_outcome = unify_pool(env, pool, *l_closure, *r_closure, ctx.mode);
|
||||||
|
|
||||||
|
@ -2926,6 +2926,7 @@ fn unify_zip_slices<M: MetaCollector>(
|
||||||
pool: &mut Pool,
|
pool: &mut Pool,
|
||||||
left: SubsSlice<Variable>,
|
left: SubsSlice<Variable>,
|
||||||
right: SubsSlice<Variable>,
|
right: SubsSlice<Variable>,
|
||||||
|
mode: Mode,
|
||||||
) -> Outcome<M> {
|
) -> Outcome<M> {
|
||||||
let mut outcome = Outcome::default();
|
let mut outcome = Outcome::default();
|
||||||
|
|
||||||
|
@ -2935,7 +2936,7 @@ fn unify_zip_slices<M: MetaCollector>(
|
||||||
let l_var = env.subs[l_index];
|
let l_var = env.subs[l_index];
|
||||||
let r_var = env.subs[r_index];
|
let r_var = env.subs[r_index];
|
||||||
|
|
||||||
outcome.union(unify_pool(env, pool, l_var, r_var, Mode::EQ));
|
outcome.union(unify_pool(env, pool, l_var, r_var, mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
outcome
|
outcome
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue