Skip to content

Commit a7ac03e

Browse files
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]
1 parent 06ffc8c commit a7ac03e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: compiler/src/dotty/tools/dotc/typer/Inferencing.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,9 @@ trait Inferencing { this: Typer =>
706706
else
707707
typr.println(i"no interpolation for nonvariant $tvar in $state")
708708
)
709-
buf.toList
709+
// constrainIfDependentParamRef could also have instantiated tvars added to buf before the check
710+
buf.filterNot(_._1.isInstantiated).toList
711+
end toInstantiate
710712

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

0 commit comments

Comments
 (0)