Skip to content

Commit e41045e

Browse files
committed
not constrain if formal contains instantiated type vars
1 parent e5b2e76 commit e41045e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4364,7 +4364,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
43644364
val tm = new TypeMap:
43654365
def apply(t: Type): Type = t match
43664366
case tvar: TypeVar =>
4367-
formalConstrained |= ctx.typerState.constraint.contains(tvar)
4367+
formalConstrained |= ctx.typerState.constraint.contains(tvar) || tvar.instanceOpt.exists
43684368
val inst = tvar.instanceOpt
43694369
if (inst.exists && !formalConstrained) mapOver(inst) else tvar
43704370
case _ =>

0 commit comments

Comments
 (0)