Skip to content

Conversation

@smarter
Copy link
Member

@smarter smarter commented Feb 5, 2016

Review by @odersky, this is an alternative to #1054


When wildApprox encounters a PolyParam it approximates it by its
bounds in the current constraint set, but this is incorrect if
TypevarsMissContext is set, we might get the bounds of another use of
this PolyType. This is exactly what happened in i1044.scala where the
implicit view refArrayOps needs to be used twice with two different
type parameters.

The fix is to approximate a PolyParam by its original bounds in its
PolyType if TypevarsMissContext is set.

This fix was inspired by the approach of #1054.

When `wildApprox` encounters a PolyParam it approximates it by its bounds in the current constraint set, but this is incorrect if `TypevarsMissContext` is set, we might get the bounds of another use of this `PolyType`. This is exactly what happened in i1044.scala where the implicit view `refArrayOps` needs to be used twice with two different type parameters. The fix is to approximate a PolyParam by its original bounds in its PolyType if `TypevarsMissContext` is set. This fix was inspired by the approach of scala#1054.
smarter added a commit that referenced this pull request Feb 6, 2016
Third try for a fix for #1044: handle TypevarsMissContext mode in wildApprox
@smarter smarter merged commit ffcc27b into scala:master Feb 6, 2016
@smarter smarter mentioned this pull request Feb 6, 2016
@allanrenucci allanrenucci deleted the fix-#1044-take-3 branch December 14, 2017 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants