-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Bad code for pattern matches with values. #1463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
See the discussion in https://issues.scala-lang.org/browse/SI-1503 for more context, note that this is one of these cases where you can't trust the spec: it was updated following some discussions in this bug report and the proposed solution was later found out to be incorrect and reverted, but the spec wasn't updated. Anyway the only sane and correct thing to do here is that in: (Vector(): Any) match { case n @ Nil => n }
|
This is also be the behaviour of Scala 2.12 and Scala 2.11 with |
Consider the following test case adapted from pending/run/t3150:
Dotty causes a class cast exception in three scenarios, scalac only in the last. Each class cast exception is a bug. We should decide what the precise typing and comparison rules for pattern matches involving equals tests are.
The text was updated successfully, but these errors were encountered: