Skip to content

Commit eb67a33

Browse files
committed
Revert "fix: type-var bug"
This reverts commit 6fff895.
1 parent a10bc83 commit eb67a33

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/erg_compiler/context/unify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2324,7 +2324,7 @@ impl Context {
23242324
let new_sub = self
23252325
.eval_t_params(maybe_sub.clone(), self.level, loc)
23262326
.map_err(|(_, errs)| errs)?;
2327-
if maybe_sub.is_unbound_var() && new_sub != Never && &new_sub != maybe_sub {
2327+
if new_sub != Never && &new_sub != maybe_sub {
23282328
maybe_sub.link(&new_sub, unifier.undoable);
23292329
}
23302330
let new_super = self

crates/erg_compiler/ty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3702,7 +3702,7 @@ impl Type {
37023702
Type::FreeVar(fv) if fv.is_linked() => {
37033703
fv.crack().destructive_coerce();
37043704
}
3705-
Type::FreeVar(fv) if !fv.is_generalized() && fv.is_unbound_and_sandwiched() => {
3705+
Type::FreeVar(fv) if fv.is_unbound_and_sandwiched() => {
37063706
let (sub, _sup) = fv.get_subsup().unwrap();
37073707
if !sub.contains_tvar(fv) {
37083708
sub.destructive_coerce();

0 commit comments

Comments
 (0)