Skip to content

Commit

Permalink
fix: unification bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed May 24, 2024
1 parent 26a9524 commit 2282d12
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/erg_compiler/context/unify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ impl<'c, 'l, 'u, L: Locational> Unifier<'c, 'l, 'u, L> {
// self.occur_inner(&sup_t, maybe_sup)
})?;
}
if let Some((_sub_t, sup_t)) = sup.get_subsup() {
if let Some((sub_t, sup_t)) = sup.get_subsup() {
sup.do_avoiding_recursion(|| {
// occur(?U, ?T(:> ?U or Y)) ==> OK
// self.occur_inner(maybe_sub, &sub_t)?;
self.occur_inner(maybe_sub, &sub_t)?;
self.occur_inner(maybe_sub, &sup_t)
})?;
}
Expand Down
7 changes: 7 additions & 0 deletions crates/erg_compiler/tests/infer.er
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ ff! x: Str or NoneType =
do!: f0!()
f0!() = print! ""
f1! _: Str = f0!()

arr = [1]
for! arr, (_,) =>
if! True, do!:
if! True, do!:
if! True, do!:
todo()

0 comments on commit 2282d12

Please sign in to comment.