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
I expect the compiler to either do the right match (accepting string value for val b) or give some diagnostic about the limitation of match types not playing with structural patterns
The text was updated successfully, but these errors were encountered:
7 |val b: F[{type A = Int}] = "asd" // Found:("asd" : String) Required: F[Object{A = Int}]
| ^^^^^
| Found: ("asd" : String)
| Required: F[Object{A = Int}]
|
| Note: a match type could not be fully reduced:
|
| trying to reduce F[Object{A = Int}]
| failed since selector Object{A = Int}
| does not match case Object{A = Float} => Int
| and cannot be shown to be disjoint from it either.
| Therefore, reduction cannot advance to the remaining case
|
| case Object{A = Int} => String
|
So it explains what goes wrong, but we should be able to make the disjointness check more precise, so that this passes.
Compiler version
3.1.2
Minimized code
Output
Expectation
I expect the compiler to either do the right match (accepting string value for
val b
) or give some diagnostic about the limitation of match types not playing with structural patternsThe text was updated successfully, but these errors were encountered: