Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[SUPERSEDED] Remove adaptation of 0-arg methods under -Xsource:3.0 and preserve infix unit value #6974

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

Closed
wants to merge 2 commits into from

Conversation

som-snytt
Copy link
Contributor

Commits not reordered or squashed.

Besides updating check files, attempts to preserve unit value in

"" + ()

which currently warns because it takes the empty parens as an empty arg list instead of unit value.

The spec is clear that "several args in parens" are taken as an arg list, not empty parens.

@som-snytt
Copy link
Contributor Author

som-snytt commented Jul 26, 2018

Hey, who put that red ex there?

We need a label for "works on my machine."

[test] [error] /home/jenkins/workspace/scala-2.13.x-validate-main@2/src/compiler/scala/tools/nsc/transform/CleanUp.scala:248: no arguments allowed for nullary method GETCLASS: ()CleanUp.this.global.Apply
[test] [error]               def lookup      = Apply(cache, List(qual1() GETCLASS()))                                // get Method object from cache
[test] [error]                                                           ^
[test] [error] /home/jenkins/workspace/scala-2.13.x-validate-main@2/src/compiler/scala/tools/nsc/transform/CleanUp.scala:288: no arguments allowed for nullary method GETCLASS: ()CleanUp.this.global.Apply
[test] [error]               IF ((qual1() GETCLASS()) DOT nme.isArray) THEN genArrayCall ELSE genDefaultCall
[test] [error]                            ^
[test] [error] /home/jenkins/workspace/scala-2.13.x-validate-main@2/src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala:163: overloaded method value APPLY with alternatives:
[test] [error]   (params: List[MatchCodeGen.this.global.Tree])MatchCodeGen.this.global.Apply <and>
[test] [error]   (params: MatchCodeGen.this.global.Tree*)MatchCodeGen.this.global.Apply
[test] [error]  cannot be applied to (Unit)
[test] [error]         protected def zero: Tree = nextCase APPLY ()
[test] [error]                                             ^
[test] [error] /home/jenkins/workspace/scala-2.13.x-validate-main@2/src/compiler/scala/tools/nsc/typechecker/Implicits.scala:1165: no arguments allowed for nullary method findBest: ()Implicits.this.SearchResult
[test] [error]       else new ImplicitComputation(implicitInfoss, isLocalToCallsite) findBest()
[test] [error]                                                                       ^
[test] [error] four errors found

@som-snytt som-snytt force-pushed the wip/get-thee-to-a-nullary branch from 1eb009d to bb7a333 Compare July 28, 2018 03:05
@som-snytt
Copy link
Contributor Author

This looked like something weird, but actually it's simple:

tree GETCLASS() is bad syntax, and now we notice.

@som-snytt som-snytt force-pushed the wip/get-thee-to-a-nullary branch 2 times, most recently from 1e6e88a to c0f7c0c Compare July 28, 2018 14:36
@som-snytt som-snytt changed the title Repair nullary wip and preserve infix unit value [ci: last-only] Repair nullary wip and preserve infix unit value Jul 28, 2018
@SethTisue
Copy link
Member

needs rebase

@SethTisue SethTisue modified the milestones: 2.13.0-M5, 2.13.0-RC1 Aug 7, 2018
@SethTisue
Copy link
Member

quoth the raven: needs rebase

@som-snytt som-snytt force-pushed the wip/get-thee-to-a-nullary branch from c0f7c0c to 2b834aa Compare August 7, 2018 13:17
@som-snytt som-snytt changed the title Repair nullary wip and preserve infix unit value Remove adaptation of 0-arg methods under -Xsource:3.0 and preserve infix unit value Sep 11, 2018
@som-snytt som-snytt mentioned this pull request Oct 12, 2018
@adriaanm
Copy link
Contributor

Sorry, I forgot about this one. I was looking at what remained TODO in scala/scala-dev#471, and this PR was not referenced.

How about focussing this PR on the last commit? #7328, I think, subsumes the first two (it's a little less ambitious/polished, but it will do, I'd say)

@SethTisue
Copy link
Member

note that #7328 is now merged

@som-snytt som-snytt force-pushed the wip/get-thee-to-a-nullary branch 2 times, most recently from bda8c90 to 2bf5a60 Compare December 5, 2018 09:26
@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Dec 5, 2018
@som-snytt som-snytt force-pushed the wip/get-thee-to-a-nullary branch from 43222e7 to 696f4c4 Compare December 18, 2018 19:37
@som-snytt som-snytt requested a review from lrytz December 18, 2018 19:38
@som-snytt
Copy link
Contributor Author

Rebased and squashed for lrytz's 👀 .

Also TIL 👁️‍🗨️ for anti-bullying, which is another reason lrytz is the fellow to have on your PR review board.

The M$ icon looks more like "big brother is watching everything you say."

@adriaanm adriaanm requested review from adriaanm and removed request for lrytz January 9, 2019 16:34
@som-snytt
Copy link
Contributor Author

Oh thanks @adriaanm I see you recently took the review upon yourself. You needn't feel too bad that Eugene's change has been waiting since last June: "get thee to a nullary" is still funny!

Rebasing is getting kind of stale, however.

eed3si9n and others added 2 commits January 13, 2019 20:48
Get thee to a nullary, go. Farewell -Xfuture.
When parsing infix expression, a Parens node
is created for parens. If it is empty, they
wrote unit value. Otherwise, per the spec,
the possibly many comma-separated arguments
are taken as arguments.

`() == ()` is now what it is.

`x op()` is corrected to `x.op()`. The dot-averse
must rely on postfix and empty application
to use `x op`.

Restore wording adapt is removed.
@som-snytt som-snytt force-pushed the wip/get-thee-to-a-nullary branch from 696f4c4 to 6e94408 Compare January 14, 2019 05:01
@som-snytt som-snytt closed this Jan 20, 2019
@som-snytt som-snytt deleted the wip/get-thee-to-a-nullary branch January 20, 2019 14:39
@som-snytt som-snytt removed the release-notes worth highlighting in next release notes label Jan 25, 2019
@SethTisue
Copy link
Member

SethTisue commented Jan 25, 2019

what wasn't superseded by #7328 is now superseded by #7684

@SethTisue SethTisue removed this from the 2.13.0-RC1 milestone Feb 22, 2019
@som-snytt som-snytt changed the title Remove adaptation of 0-arg methods under -Xsource:3.0 and preserve infix unit value [SUPERSEDED] Remove adaptation of 0-arg methods under -Xsource:3.0 and preserve infix unit value Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants