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

Add -experimental compiler flags #18571

Merged

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Sep 19, 2023

When enabled, all top-level definitions are annotated as @experimental.
This implies that all experimental language features and definitions can
be used in this project.

Note that this does not change the strong guarantees on stability of
non-experimental code. The experimental features can only be used in a
experimental scope (transitively).

This flags does not affect the use of ResearchPlugin.

Follow up of https://contributors.scala-lang.org/t/behaviour-of-experimental-in-scala-3/6309/27?u=nicolasstucki

@nicolasstucki nicolasstucki added the needs-minor-release This PR cannot be merged until the next minor release label Sep 19, 2023
@nicolasstucki nicolasstucki self-assigned this Sep 19, 2023
@@ -0,0 +1,18 @@
//> using options -experimental -Yno-experimental
Copy link
Contributor Author

Choose a reason for hiding this comment

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

-Yno-experimental is set to disable experimental features on this snapshot. -experimental is set to add @experimental to the top-level definitions.

@nicolasstucki nicolasstucki marked this pull request as ready for review September 21, 2023 09:20
@nicolasstucki nicolasstucki added this to the 3.4.0 milestone Sep 21, 2023
@nicolasstucki nicolasstucki added the release-notes Should be mentioned in the release notes label Sep 21, 2023
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

compiler/src/dotty/tools/dotc/transform/PostTyper.scala Outdated Show resolved Hide resolved
docs/_docs/reference/experimental/overview.md Outdated Show resolved Hide resolved
@odersky odersky assigned nicolasstucki and unassigned odersky Oct 1, 2023
When enabled, all top-level definitions are annotated as `@experimental`.
This implies that all experimental language features and definitions can
be used in this project.

Note that this does not change the strong guarantees on stability of
non-experimental code. The experimental features can only be used in a
experimental scope (transitively).

This flags does not affect the use of `ResearchPlugin`.
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

LGTM for now.

Should this go into the tasty attribute that contains already the other tags instead of being a separate annotation? If yes, that could be done in a follow-on PR.

@nicolasstucki
Copy link
Contributor Author

Should this go into the tasty attribute that contains already the other tags instead of being a separate annotation? If yes, that could be done in a follow-on PR.

Technically it could work. Not sure if it would be benefitial.

@nicolasstucki nicolasstucki merged commit 9136582 into scala:main Nov 14, 2023
18 checks passed
@nicolasstucki nicolasstucki deleted the add-experimental-compiler-flag branch November 14, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-minor-release This PR cannot be merged until the next minor release release-notes Should be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants