Skip to content

Commit c6ab542

Browse files
EugeneFlesselleWojciechMazur
authored andcommitted
Adapt toInstantiate in interpolateTypeVars to consider c608177
constrainIfDependentParamRef can now not only instantiate the tvar being constrained, but also tvars having already been added to buf. We simply re-filter buf at the end as this should be a rare occurrence. [test_scala2_library_tasty] [Cherry-picked a7ac03e]
1 parent e1aeea5 commit c6ab542

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,9 @@ trait Inferencing { this: Typer =>
647647
else
648648
typr.println(i"no interpolation for nonvariant $tvar in $state")
649649
)
650-
buf.toList
650+
// constrainIfDependentParamRef could also have instantiated tvars added to buf before the check
651+
buf.filterNot(_._1.isInstantiated).toList
652+
end toInstantiate
651653

652654
def typeVarsIn(xs: ToInstantiate): TypeVars =
653655
xs.foldLeft(SimpleIdentitySet.empty: TypeVars)((tvs, tvi) => tvs + tvi._1)

0 commit comments

Comments
 (0)