-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Under -Xsource:3
, deprecate infix named args [ci: last-only]
#10857
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
Under -Xsource:3
, deprecate infix named args [ci: last-only]
#10857
Conversation
380a701
to
d360d4f
Compare
wdyt about only warning under |
tired: warn under wired: default to The question whether it's worth doing anything on Scala 2 where there is no development branch (nothing can change) made me second-guess whether this is worth doing on Scala 3, so I'll comment on the discussion. I see discussions don't get a link when mentioned. |
Coincidentally scala/scala3#21681 named tuples forces the issue. That got a mention on the discussion (the discussion between myself). |
d360d4f
to
cf956f7
Compare
cf956f7
to
377a937
Compare
Adds |
Requesting Seth as a reviewer and cashing in a favor for |
377a937
to
a00a0d0
Compare
I have to review the last commit, or ask Seth. I just noticed:
where it's taken as a tuple, as intended. So this commit makes the warning opt-in and the nowarn will be unnecessary. OK, I see 3.5.2 prefers multiarg infix over tupled in the overloaded case. 2.13.15 does the same. In other words, "How do I warn about that, again?"
Aha, it does not warn for the infix syntax! As a footnote, I remember saying that multiarg infix specifically means multiarg, which is why nilary and unary work correctly; for example, |
I can't delete the |
-Xsource:3
, deprecate infix named args [ci: last-only]
In Scala 3.6, named tuples makes
Option apply (x = 42)
an optional tuple.Under
-Xsource:3
, deprecate named args in infix applications (arity one, a single arg).Demote
-Xlint:multiarg-infix
to-Wmultiarg-infix
, to warn for infix-style applications of arity greater than one. These work the same in Scala 3.6.Addresses scala/scala3#19072