Skip to content

Commit

Permalink
Adapt toInstantiate in interpolateTypeVars to consider c608177
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
EugeneFlesselle committed May 19, 2024
1 parent 06ffc8c commit a7ac03e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/typer/Inferencing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,9 @@ trait Inferencing { this: Typer =>
else
typr.println(i"no interpolation for nonvariant $tvar in $state")
)
buf.toList
// constrainIfDependentParamRef could also have instantiated tvars added to buf before the check
buf.filterNot(_._1.isInstantiated).toList
end toInstantiate

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

0 comments on commit a7ac03e

Please sign in to comment.