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 26, 2024
1 parent ab06244 commit 0ce9a1a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/erg_compiler/context/unify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,10 @@ impl<'c, 'l, 'u, L: Locational> Unifier<'c, 'l, 'u, L> {
self.sub_unify(maybe_sub, &sup)?;
}
let mut new_sub = self.ctx.union(maybe_sub, &sub);
if maybe_sub.qual_name() == sub.qual_name() && new_sub.has_unbound_var() {
if !sub.is_recursive()
&& maybe_sub.qual_name() == sub.qual_name()
&& new_sub.has_unbound_var()
{
let list = UndoableLinkedList::new();
if self
.ctx
Expand Down

0 comments on commit 0ce9a1a

Please sign in to comment.