Skip to content

Commit

Permalink
fix: sub-unification bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Sep 17, 2024
1 parent d115758 commit c9cbf69
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/erg_compiler/context/unify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,7 @@ impl<'c, 'l, 'u, L: Locational> Unifier<'c, 'l, 'u, L> {
// self.sub_unify(&lsub, &union, loc, param_name)?;
maybe_sup.update_tyvar(union, intersec, self.undoable, false);
}
// TODO: Preferentially compare same-structure types (e.g. K(?T) <: K(?U))
(And(ltys), And(rtys)) => {
let mut ltys_ = ltys.clone();
let mut rtys_ = rtys.clone();
Expand All @@ -1322,6 +1323,7 @@ impl<'c, 'l, 'u, L: Locational> Unifier<'c, 'l, 'u, L> {
}
}
}
// TODO: Preferentially compare same-structure types (e.g. K(?T) <: K(?U))
// Nat or Str or NoneType <: NoneType or ?T or Int
// => Str <: ?T
// (Int or ?T) <: (?U or Int)
Expand Down

0 comments on commit c9cbf69

Please sign in to comment.