Skip to content

chore: Add @nowarn annotation to LazyVals. #22270

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

Merged
merged 1 commit into from
Feb 20, 2025
Merged

Conversation

He-Pin
Copy link
Contributor

@He-Pin He-Pin commented Dec 30, 2024

Unsafe is planned to be removed in future Java versions.

Motivication:

Makes it compile on JDK 23
refs: https://openjdk.org/jeps/471

Modification:
Add @nowarn("cat=deprecation")

Result:
Compiles successfully on JDK 23

Unsafe is planed to be removed in future  Java version.
Copy link
Contributor

@som-snytt som-snytt left a comment

Choose a reason for hiding this comment

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

Non-core contributors may be more likely to keep their JDKs fresh.

@som-snytt
Copy link
Contributor

Not sure if dotty has the "nowarn suppresses no warnings" lint, but it would be nice to ensure clean compilation across JDK versions.

Also not sure whether dotty exploits newer API or if releases are built under the --java-output-version-flag whatever that is called; or whether CI building under JDK 8 is relied upon.

@He-Pin
Copy link
Contributor Author

He-Pin commented Dec 30, 2024

@som-snytt
Copy link
Contributor

This remains a hassle. Maybe there is a big picture problem here, but I just want to switch back from JDK 17 after working on a dotty ticket. However, a glitch is that I can't buildQuick to test a ticket that relies on a magic scala_legacy version which seems to be just the old runner.

Copy link
Contributor

@Gedochao Gedochao left a comment

Choose a reason for hiding this comment

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

LGTM
As per https://www.scala-lang.org/news/next-scala-lts.html, we'll be migrating from the unsafe API soon. I think this is okay as a band-aid before Scala 3.8.

@Gedochao Gedochao merged commit 4952e0a into scala:main Feb 20, 2025
29 checks passed
@SethTisue
Copy link
Member

thank you @He-Pin !

@He-Pin He-Pin deleted the jdk23 branch February 24, 2025 13:05
@WojciechMazur WojciechMazur added this to the 3.7.0 milestone Mar 11, 2025
tgodzik pushed a commit to scala/scala3-lts that referenced this pull request Apr 22, 2025
Unsafe is planned to be removed in future  Java versions.

Motivication:

Makes it compile on JDK 23
refs: https://openjdk.org/jeps/471

Modification:
Add `@nowarn("cat=deprecation")`

Result:
Compiles successfully on JDK 23
[Cherry-picked 4952e0a]
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