From 8077e55b9027bb7e881a82825c467555e4f1fac1 Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Sat, 24 Dec 2022 14:46:01 +0900 Subject: [PATCH] Update tyvar.rs --- compiler/erg_compiler/context/tyvar.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/erg_compiler/context/tyvar.rs b/compiler/erg_compiler/context/tyvar.rs index 13335f03..4a11d8ab 100644 --- a/compiler/erg_compiler/context/tyvar.rs +++ b/compiler/erg_compiler/context/tyvar.rs @@ -478,7 +478,8 @@ impl Context { Type::FreeVar(fv) if fv.constraint_is_sandwiched() => { let (sub_t, super_t) = fv.get_subsup().unwrap(); if self.level <= fv.level().unwrap() { - // REVIEW: + // if fv == ?T(<: Int, :> Add(?T)), deref_tyvar(super_t) will cause infinite loop + // so we need to force linking fv.forced_undoable_link(&sub_t); let res = self.validate_subsup(sub_t, super_t, variance, loc); fv.undo();