fix(els): shared reference bugs

This commit is contained in:
Shunsuke Shibayama 2024-05-12 16:37:35 +09:00
parent da0fb2374d
commit dc1e32f5f4
4 changed files with 35 additions and 24 deletions

View file

@ -179,7 +179,7 @@ impl<'c, 'l, 'u, L: Locational> Unifier<'c, 'l, 'u, L> {
(FreeVar(fv), _) if fv.is_linked() => self.occur_inner(&fv.crack(), maybe_sup),
(_, FreeVar(fv)) if fv.is_linked() => self.occur_inner(maybe_sub, &fv.crack()),
(FreeVar(sub), FreeVar(sup)) => {
if sub.is_unbound() && sup.is_unbound() && sub.addr_eq(sup) {
if sub.addr_eq(sup) {
Err(TyCheckErrors::from(TyCheckError::subtyping_error(
self.ctx.cfg.input.clone(),
line!() as usize,