-
Notifications
You must be signed in to change notification settings - Fork 1.1k
incorrect type checking in pattern matching #1255
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
I propose to make it both more general and simpler by decoupling the transformation from typer and doing it after pattern matcher. I propose to intercept
Here is the table for transformation:
|
@felixmulder There is an interesting bug with scalac related to this issue, which you may want to add to the test set: case class A(v: Int)
class B(v: Int) extends A(v)
object Test {
val a = new B(1)
a match { case A(_) => 1 }
} The code above looks perfectly fine, but scalac generates an error:
However, if we annotate |
This issue was resolved in #1275 |
Following code passes type checking in dotty:
In scalac it generates following error message:
The text was updated successfully, but these errors were encountered: