Skip to content
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

Accept and ignore using in method calls (to aid cross-building with Scala 3) #10064

Merged
merged 1 commit into from Jul 18, 2022

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Jun 29, 2022

Users using using on Scala 3 may use using on Scala 2 in arguments to method invocations, for purposes of cross-compilation. The using keyword is ignored and not used in that context under Scala 2.

references scala/scala3#15552

@scala-jenkins scala-jenkins added this to the 2.13.10 milestone Jun 29, 2022
@som-snytt
Copy link
Contributor Author

using ought to be the hit internet karaoke platform. Get it? "you sing"! Where do I cash in my chips?

@som-snytt som-snytt marked this pull request as ready for review July 1, 2022 13:23
class Innocent {
val using = 42
def g(i: Int) = i
def f() = g(using)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

g(using using) works too 😀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish I had thought of that one. Maybe I'll add another test class MaliciousPuns.

@lrytz
Copy link
Member

lrytz commented Jul 7, 2022

@SethTisue this could go in 2.13.9 I think.

@lrytz lrytz modified the milestones: 2.13.10, 2.13.9 Jul 7, 2022
@SethTisue SethTisue self-assigned this Jul 7, 2022
@som-snytt
Copy link
Contributor Author

Added the devilish test as suggested, and rebased and squashed.

@smarter
Copy link
Member

smarter commented Jul 8, 2022

Would you mind opening issues against https://github.com/scalameta/scalameta/issues/ and https://youtrack.jetbrains.com/issues/SCL#newissue to let them know that they need to be update their respective parser for 2.13.9?

@smarter
Copy link
Member

smarter commented Jul 8, 2022

Also I'd vote for backporting this to 2.12.

@SethTisue
Copy link
Member

2.12 backport merged: #10075

@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Jul 18, 2022
@SethTisue SethTisue merged commit f093692 into scala:2.13.x Jul 18, 2022
@som-snytt som-snytt deleted the issue/using branch July 18, 2022 21:31
@SethTisue

This comment was marked as resolved.

@SethTisue SethTisue changed the title Accept and ignore using in args Accept and ignore using in args Aug 31, 2022
@SethTisue SethTisue added release-notes worth highlighting in next release notes and removed release-notes worth highlighting in next release notes labels Aug 31, 2022
@SethTisue SethTisue changed the title Accept and ignore using in args Accept and ignore using in method signature (to aid cross-building with Scala 3) Aug 31, 2022
@SethTisue
Copy link
Member

SethTisue commented Aug 31, 2022

Would you mind opening issues against https://github.com/scalameta/scalameta/issues/ and youtrack.jetbrains.com/issues/SCL#newissue to let them know that they need to be update their respective parser for 2.13.9?

The status quo on this is that we use the "release-notes" label to indicate PRs which are compatibility concerns for tooling authors. The label also goes on other sorts of PRs, but the number of PRs with the label isn't that large and thus shouldn't be unwieldy for tooling maintainers to review.

We also use https://contributors.scala-lang.org to announce progress on upcoming releases, and we recently lengthened the span of time (now two weeks) between announcing a release candidate and actually releasing, to give tooling authors more time to adapt to recent changes such as these.

The matter is open to further discussion (on https://contributors.scala-lang.org, please, rather than on this particular PR), but I want to state clearly that the current model is that we expect tooling authors to monitor what's coming from upstream — and we're doing our best to make it reasonably convenient for them to do so. We don't expect our contributors (and ourselves) to notify individual tooling projects of individual changes.

@SethTisue SethTisue changed the title Accept and ignore using in method signature (to aid cross-building with Scala 3) Accept and ignore using in method calls (to aid cross-building with Scala 3) Sep 1, 2022
@smarter
Copy link
Member

smarter commented Sep 4, 2022

I don't know about what should happen in theory, but in practice I've had great success being proactive (https://github.com/scalameta/scalameta/issues?q=is%3Aissue+is%3Aclosed+author%3Asmarter+, https://youtrack.jetbrains.com/issues?q=by:%20smarter%20), whereas here it seems that IntelliJ isn't aware of the change from this PR even though 2.13.9 is about to be released.

Related discussion: https://github.com/scala/improvement-proposals-discussions/discussions/12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
5 participants