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
Case "a" is never matched because the if() guard always fails but using the existential type A[_] in case a also causes the match for case c to fail. Removing the type parameter on A entirely or matching against A[Any] (which gets erased anyway) in case a results in the correct output "C".
This is with Scala 2.7.2RC3.
The text was updated successfully, but these errors were encountered:
@szeiger said:
I just ran into the same problem again with some new code where it occurs without an if() guard but I wasn't able to reproduce it in a test case which is simple enough to post.
The following code prints "B" instead of the expected result "C":
Case "a" is never matched because the if() guard always fails but using the existential type A[_] in case a also causes the match for case c to fail. Removing the type parameter on A entirely or matching against A[Any] (which gets erased anyway) in case a results in the correct output "C".
This is with Scala 2.7.2RC3.
The text was updated successfully, but these errors were encountered: