Skip to content

Commit b1cc33a

Browse files
committed
Fix incorrect usage of TypeVar#inst
TypeVar#isInstantiated uses instanceOpt, which extends inst. So either use the pair .inst/.inst.exists or isInstantiated/.instanceOpt. The way it was made the TypeVar in tests/fuzzy/i9293.scala return NoType with this call. Looking around, looks like the usage of .inst directly is much more rare and nowhere within TypeComparer (or its parents) so I opted for instanceOpt.
1 parent fe77e3f commit b1cc33a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: compiler/src/dotty/tools/dotc/core/TypeComparer.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1596,7 +1596,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
15961596
val tycon1 = liftToThis(tp.tycon)
15971597
if (tycon1 ne tp.tycon) tp.derivedAppliedType(tycon1, tp.args) else tp
15981598
case tp: TypeVar if tp.isInstantiated =>
1599-
liftToThis(tp.inst)
1599+
liftToThis(tp.instanceOpt)
16001600
case tp: AnnotatedType =>
16011601
val parent1 = liftToThis(tp.parent)
16021602
if (parent1 ne tp.parent) tp.derivedAnnotatedType(parent1, tp.annot) else tp

0 commit comments

Comments
 (0)