Unsound GADT constraints with pattern alternatives #22805
Labels
area:gadt
itype:bug
itype:soundness
Soundness bug (it lets us compile code that crashes at runtime with a ClassCastException)
Milestone
Originally reported by @szeiger at scala/bug#13090
It seems only the constraints from the first pattern are applied, so
T = String
when typing the case body.The bug report initially asked if it's possible to support this case:
The text was updated successfully, but these errors were encountered: