make effectful functions unify properly

This commit is contained in:
faldor20 2024-12-01 16:09:42 +10:00
parent d7556be7bf
commit 8549e48d0b
No known key found for this signature in database
GPG key ID: F2216079B890CD57

View file

@ -3345,6 +3345,17 @@ fn unify_flat_type<M: MetaCollector>(
outcome
}
(Func(args, closure, ret, fx), EffectfulFunc) => {
let mut outcome = unify_pool(env, pool, *fx, Variable::EFFECTFUL, ctx.mode);
outcome.union(merge(
env,
ctx,
Structure(Func(*args, *closure, *ret, Variable::EFFECTFUL)),
));
outcome
}
(FunctionOrTagUnion(tag_names, tag_symbols, ext), Func(args, closure, ret, fx)) => {
unify_function_or_tag_union_and_func(
env,