Revert "fix: type-var bug"

This reverts commit 6fff8955bb.
This commit is contained in:
Shunsuke Shibayama 2025-02-25 16:09:24 +09:00
parent a10bc83d99
commit eb67a33a12
2 changed files with 2 additions and 2 deletions

View file

@ -2324,7 +2324,7 @@ impl Context {
let new_sub = self
.eval_t_params(maybe_sub.clone(), self.level, loc)
.map_err(|(_, errs)| errs)?;
if maybe_sub.is_unbound_var() && new_sub != Never && &new_sub != maybe_sub {
if new_sub != Never && &new_sub != maybe_sub {
maybe_sub.link(&new_sub, unifier.undoable);
}
let new_super = self

View file

@ -3702,7 +3702,7 @@ impl Type {
Type::FreeVar(fv) if fv.is_linked() => {
fv.crack().destructive_coerce();
}
Type::FreeVar(fv) if !fv.is_generalized() && fv.is_unbound_and_sandwiched() => {
Type::FreeVar(fv) if fv.is_unbound_and_sandwiched() => {
let (sub, _sup) = fv.get_subsup().unwrap();
if !sub.contains_tvar(fv) {
sub.destructive_coerce();