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
Fix check whether classtag can be generated for match types (#16708)
The previous check, meant to address #15618, tested whether all
alternatives of a match type had the same classtag and only then
permitted a classtag for the match type. This was the wrong test. It did
not work for recursive match types, because it could lead to stack
overflow for them. And it did not take into account that match types
could be reduced.
A better test is to simply declare that match types themselves don't
have a stable erasure, just like TypeBounds don't have a stable erasure.
If we find an applied type with a match type as definition, we proceed
to its translucent supertype, which will try a match type reduction. If
that succeeds we produce the classtag of the redux. If not, we end up
with an unreduced matchtype and refuse to generate a classtag for it.
Fixes#16706Fixes#16707
0 commit comments