-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fewerBraces example does not actually work #18014
Comments
@mbovel Potenitally small enough for a spree ? |
Should it actually work? The correct syntax right now is List(1,2,3).map: x =>
val y = x - 1
y * y |
That's why it's still "needs triage", no matter if it's a documentation or an implementation issue, both are on this repo ^^ |
In this case, the sip agrees with the reference: So I would consider this an implementation bug |
I think it's an implementation bug |
In fact, this works in 3.3.1 RC1. |
Does it ? List(1,2,3).map:
x => // indented definitions expected, identifier x found
x https://scastie.scala-lang.org/1ke6Wbu5TYCLR9fwVuIShA Note that some indent based things behave differently toplevel than they do nested in a block |
It works in the REPL and in a standalone file. Maybe scastie is not on the latest version yet? |
FWIW (Edit: for what it's worth, it compiles for me on HEAD, version shown):
Just trying to keep up. |
@som-snytt, I don't understand ^^' |
I could not replicate either, so I opened a PR adding relevant tests (which will automatically close this issue) |
@Sporarum Scastie has more problems, even with basic examples: https://scastie.scala-lang.org/5B8ER9m9RWyec8LXSzLRow |
I see, thank you ! |
Compiler version
Scala 3.3.0
Minimized code & Output
https://scastie.scala-lang.org/2v7yp07mQLicgj9PPuC46g
Taken from optional braces for method arguments
More Minimised
https://scastie.scala-lang.org/uzRJEI6wTsCrQDAwucv8cg
Expectation
Should not throw an error
(or reference should be updated)
The text was updated successfully, but these errors were encountered: