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
Treat wildcard args and pattern type variables the same
In a type pattern, a wildcard argument and a type variable needs to be treated the same.
I.e. it should make no difference if I have
C[_ >: L <: H]
or
C[t >: L <: H]
where `t` is unused. Previously, the two constructs had largely different codepaths with
different things that failed and worked. This fix is necessary to mitigate the fix for
#1754. The latter fix uncovered several problems with the way wildcard arguments in
patterns were treated.
The change also uncovered a problem in transforms: FirstTransform eliminates all type
nodes wnd with it any binders bound type symbols. This means that subsequently patVars
is wrong, and therefore a TreeTypeMap over a pattern will no longer duplicate pattern-
bound type variables. This caused Ycheck to fail after TailRec.
The fix is to keep pattern bound type variables around in an internal annotation, which
is understood by patVars.
0 commit comments