You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During match type reduction, if we're going to allow approximating
we must further restrict match types from widening to its bound.
Failing to do so will record GADT constraint bounds that parameters will
be approximated to, which is lossy and leads to a loss of type checking
completion..
For instance, in a variant of i13633 with an added `<: (Boolean,
Boolean)` bound to `PlusTri`, when reducing `PlusTri[a, b, O] match {
case (x, y) => ... }`, widening the expansion of `PlusTri[a, b, O]` to
its bound `(Boolean, Boolean)`, causes the recording the constraints
bounds `x >: Boolean` and `y >: Boolean` and then reduction instantiates
`x` and `y` to Boolean, losing the precision that comes from `a`, `b`,
and `O`.
This came up while implementing bounds checking to match type case
bodies, and requires an important fix to PatternTypeConstrainer
(the use of typeSymbol's) so the tests that require this are part of
that effort.
0 commit comments