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 e5b2e76 commit e41045eCopy full SHA for e41045e
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -4364,7 +4364,7 @@ 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)
+ formalConstrained |= ctx.typerState.constraint.contains(tvar) || tvar.instanceOpt.exists
4368
val inst = tvar.instanceOpt
4369
if (inst.exists && !formalConstrained) mapOver(inst) else tvar
4370
case _ =>
0 commit comments