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
post-match mutation must not affect pattern variable #5158
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5158?orig=1 |
@adriaanm said: |
@retronym said: |
@dragos said: |
@adriaanm said: |
@retronym said: +1 for local variables. Adriaan: do you plan to add locals for bound names that are used in the body, or for all bound names? The latter would be convenient while debugging. |
@adriaanm said: |
@retronym said: scrut match {
case (Foo(x, y), _) =>
// generate a var for constructor patterns
val foo$1: Foo
// in addition to the user provided binders
val x: Int
val y: String
} |
@adriaanm said (edited on Jul 20, 2012 8:51:03 AM UTC): |
This code prints "1" instead of "0". However if you uncomment first println you will get what expected "0\n0".
The text was updated successfully, but these errors were encountered: