-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Make postfixOps syntax an error (not just a warning) unless the feature is explicitly enabled [ci: last-only] #6831
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
Conversation
needs rebase |
c6a05ba
to
6b79e67
Compare
@som-snytt what's next here? |
@SethTisue IIUC @adriaanm has to defer things he'd rather be doing to do some sort of restarr dance. "Dancing with the Restarrs!" Some people would love to get a shot at that. |
When starr becomes M5, we can rebase and merge this for RC1. Right? |
@som-snytt when you wish upon a STARR you wake up and M5 is far behind you ✨ |
6b79e67
to
afd25cb
Compare
🕺 🌠 |
compilation errors when building partest |
afd25cb
to
2f6223a
Compare
looks like this needs the special |
That should be in starr. Maybe the update includes an sbt change. The test requires the xsbt file be compiled by itself. |
Indeed, debug says
I probably won't bother checking if the behavior changed; the test for one unit was just for insurance, since the test only checks trailing characters in the path. Oh wait, it was also nice not to check a possibly long list of units for the special name. I wonder if @dwijnand knows if Looking at the kludge now, I see it sets the language option, but doesn't restore it. Another fix would have been to inject a root import of the language feature, now that I know how root imports work. One could also imagine encapsulating the special knowledge about the path in SourceFile. |
Well there's sbt/zinc@c60ff23, but that's not that recent. |
@dwijnand Thanks. My issue is that I got the idea that the |
@@ -1,13 +1,11 @@ | |||
/* __ *\ | |||
** ________ ___ / / ___ Scala API ** | |||
** / __/ __// _ | / / / _ | (c) 2003-2015, LAMP/EPFL ** | |||
** / __/ __// _ | / / / _ | (c) 2003-2018, LAMP/EPFL ** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What could it hurt? he said.
Under 0.13.16. (The fix is in 0.13.18, sbt/sbt#4132.)
|
The compat kludge is improved in #7319 |
2f6223a
to
55f2851
Compare
There ought to be a scalafix for:
|
That "double-feature" test has a clever name, but it relies on postfix to trigger, probably because typechecking happens twice but not silently. But it won't be reported twice as an error. Ironic! as Alanis would say. The test should be changed to just report twice manually. |
This commit turns the feature warning into an error if `postfixOps` is not enabled. Popular sentiment has turned against the feature, and requiring enablement raises the barrier to entry. In particular, beginners will not stumble across it accidentally.
55f2851
to
3e0d8cb
Compare
This seems to be ready. @SethTisue merge? |
I need to brace myself for the likely avalanche of needed project tweaks in the community build first :-) |
Ah, right :-) |
@som-snytt would you mind updating the PR description to briefly describe and justify the change, since it will be linked from the release notes?I think this change could be surprising and annoying for some users, so I think we should have some justification only one click away from the release notes. (I'm strongly in favor of the change regardless, of course. language simplification, onward!) |
@odersky when you're listing language features that are being removed, e.g. procedure syntax, you might like to include this as well |
it has been a puny avalanche so far, only a few pebbles here and there 👍 |
also fix compile error since Scala 2.13 scala/scala#6831
follow up on scala#6831
Follows up #6559 with requiring postfix flag.
This change makes the postfixOps language feature more opt-in, to discourage newbies from exploiting the feature and falling into its snares.
The tide turned against postfix syntax on the forum.
Codebases relying on postfix syntax will want to enable
-language:postfixOps
.