We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
object Test { def main(args: Array[String]): Unit = { ("": Any) match { case a @ Test => 1 case _ => 2 } } }
Will fail at runtime when the matched string is casted to Test (which should not happen)
Test
The pattern match is expanded to the following code after patternMatcher
patternMatcher
{ case val x1: Any = "": Any case val a: Test.type = x1.asInstanceOf[Test.type] if Test.==(x1) then { println(1) } else { println(2) } }
Clearly the case val a: Test.type = x1.asInstanceOf[Test.type] should go inside the if Test.==(x1) then
case val a: Test.type = x1.asInstanceOf[Test.type]
if Test.==(x1) then
The text was updated successfully, but these errors were encountered:
Somewhat related to #1463
Sorry, something went wrong.
fix scala#3179: bind should be nested in the plan for body
635d7a7
Merge pull request #3183 from dotty-staging/fix-3179
bea77a7
fix #3179: bind should be nested in the plan for body
No branches or pull requests
Will fail at runtime when the matched string is casted to
Test
(which should not happen)The pattern match is expanded to the following code after
patternMatcher
Clearly the
case val a: Test.type = x1.asInstanceOf[Test.type]
should go inside theif Test.==(x1) then
The text was updated successfully, but these errors were encountered: