fix: dict type bug

This commit is contained in:
Shunsuke Shibayama 2024-09-28 00:29:48 +09:00
parent 3f61bc5c17
commit 144a05ec6b
7 changed files with 82 additions and 27 deletions

View file

@ -1497,11 +1497,7 @@ impl<'c, 'l, 'u, L: Locational> Unifier<'c, 'l, 'u, L> {
return Ok(());
}
let sub = mem::take(&mut sub);
let new_sup = if let Some(new_sup) = self.ctx.min(&sup, maybe_sup).either() {
new_sup.clone()
} else {
self.ctx.intersection(&sup, maybe_sup)
};
let new_sup = self.ctx.intersection(&sup, maybe_sup);
self.sub_unify(&sub, &new_sup)?;
// ?T(:> Int, <: Int) ==> ?T == Int
// ?T(:> List(Int, 3), <: List(?T, ?N)) ==> ?T == List(Int, 3)