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
Assign is context-sensitive due to named arguments #8206
Comments
Imported From: https://issues.scala-lang.org/browse/SI-8206?orig=1 |
@retronym said: scala> object O { var x = 0 ; def foo = synchronized { x = 1 } }
defined object O
scala> O.foo; O.x
res0: Int = 1 |
@retronym said: |
@densh said: |
Ryan Hendrickson (ryan.hendrickson_bwater) said: doUpdate(_.copy(someField = _, anotherField = _)) but instead I had to write doUpdate((a, b, c) => a.copy(someField = b, anotherField = c)) #firstworldprogrammingproblems Not a bug, as spec'd, etc.; but am I correct in guessing that this proposed change would mean that the parser would recognize |
@lrytz this is no longer applicable thanks to the ambiguity going away in 2.13, right? |
At the moment Assign is context sensitive due to the fact that it can't be distinguished from named argument:
In order to minimize ambiguity we can force people who really want to have assign in that position should add extra parens or curly braces to disambiguate:
This would allow us to replace AssignOrNamedArg tree with just NamedArg.
The text was updated successfully, but these errors were encountered: