case
on the same line as :
in partial functions
#22016
Replies: 3 comments
-
In this neighborhood
|
Beta Was this translation helpful? Give feedback.
-
I'd be happy to contribute this but I have no idea where to start. Can someone hint at where to look to implement such change? |
Beta Was this translation helpful? Give feedback.
-
"Parens vs braces" is the new "tabs vs spaces". I expressed hope that the new SIP to allow parens around cases will also cover the "one-liner" examples. The motivation is that if it allows the one-liner
then it's also reasonable to accept
and then when it's not a one-liner but still a single case
which is further motivated by manual parameter untupling
Note that it does not yet accept one-liners after colon:
The previous judgment was that braceless colon is not intended to eliminate parens; but maybe that will change with the new front in the war between braces and parens. That is, all the options for bracketing code get taken to their logical conclusion in the brackocalypse. Abrackalypse? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Any reasons why not to make the following compile:
https://scastie.scala-lang.org/asibTVDBSWiaMPZEU1I9nA
as opposed to the compiling:
https://scastie.scala-lang.org/C9LRPacdQsib1wMFdQUKYg
Especially that the following works:
https://scastie.scala-lang.org/mHxCBmcQSS6lVLXHto24tw
Thanks
Beta Was this translation helpful? Give feedback.
All reactions