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

Warn about @elidable under -Xsource:3 #10377

Merged
merged 1 commit into from Aug 23, 2023

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Apr 19, 2023

Follow-up to #10408
Addresses scala/docs.scala-lang#2288

@scala-jenkins scala-jenkins added this to the 2.13.12 milestone Apr 19, 2023
@SethTisue SethTisue added the release-notes worth highlighting in next release notes label Apr 19, 2023
@som-snytt som-snytt marked this pull request as ready for review April 19, 2023 12:58
@som-snytt
Copy link
Contributor Author

or maybe that is too annoying, as there is no replacement idiom.

@lrytz
Copy link
Member

lrytz commented Jun 2, 2023

Yeah, let's keep an eye on scala/scala3#17329 and close this for now.

@lrytz lrytz closed this Jun 2, 2023
@SethTisue SethTisue removed this from the 2.13.12 milestone Jun 2, 2023
@SethTisue
Copy link
Member

-Xmigration exists for this kind of thing, though I suspect it's little-used.

@SethTisue
Copy link
Member

(Another possible venue is the Scala 3 migration tool.)

@som-snytt
Copy link
Contributor Author

At the definition, I would just deprecate, except we need deprecate under the unfortunate -Xsource:3.

Shall I reopen this for elidable? I suggested somewhere that dotty should warn that it doesn't support it, instead of silently ignoring it.

@som-snytt som-snytt reopened this Jun 5, 2023
@scala-jenkins scala-jenkins added this to the 2.13.12 milestone Jun 5, 2023
@som-snytt som-snytt changed the title Deprecate specialized under -Xsource:3 Warn about elidable under -Xsource:3 Jun 5, 2023
@som-snytt
Copy link
Contributor Author

The replacement idiom in the doc (for Scala 3) almost works in Scala 2, except that the conditional is not inlined.

Normally, if (false) is elided in refchecks. Currently, the optimizer doesn't touch if (1 == 1), for example, which is the result of inlining with constant value arg.

@SethTisue SethTisue modified the milestones: 2.13.12, 2.13.13 Aug 8, 2023
@lrytz
Copy link
Member

lrytz commented Aug 23, 2023

Shall I reopen this for elidable?

You confused me there for a minute :)

@lrytz lrytz merged commit 063208d into scala:2.13.x Aug 23, 2023
3 checks passed
@som-snytt som-snytt deleted the deprecate/specialized branch August 23, 2023 15:27
@SethTisue SethTisue modified the milestones: 2.13.13, 2.13.12 Aug 23, 2023
@SethTisue SethTisue changed the title Warn about elidable under -Xsource:3 Warn about @elidable under -Xsource:3 Aug 23, 2023
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
4 participants