We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e41045e commit 3a4aabdCopy full SHA for 3a4aabd
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -4364,9 +4364,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
4364
val tm = new TypeMap:
4365
def apply(t: Type): Type = t match
4366
case tvar: TypeVar =>
4367
- formalConstrained |= ctx.typerState.constraint.contains(tvar) || tvar.instanceOpt.exists
4368
- val inst = tvar.instanceOpt
4369
- if (inst.exists && !formalConstrained) mapOver(inst) else tvar
+ formalConstrained |= ctx.typerState.constraint.contains(tvar) || tvar.instanceOpt.isInstanceOf[TypeVar]
+ tvar
4370
case _ =>
4371
if formalConstrained then t
4372
else mapOver(t)
0 commit comments