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

Allow experimental language imports in experimental scopes #13417

Conversation

nicolasstucki
Copy link
Contributor

@nicolasstucki nicolasstucki commented Aug 30, 2021

A version of #13396 that only add the extra rule for top-level experimental imports.

@nicolasstucki nicolasstucki marked this pull request as ready for review August 30, 2021 10:03
@nicolasstucki nicolasstucki force-pushed the allow-experimental-imports-in-experimetnal-scopes branch 2 times, most recently from 2d61dd0 to 8e2957e Compare August 30, 2021 12:26
@nicolasstucki nicolasstucki added this to the 3.1.0 milestone Aug 30, 2021
@nicolasstucki nicolasstucki force-pushed the allow-experimental-imports-in-experimetnal-scopes branch 3 times, most recently from 5cf6c79 to c92da2e Compare August 30, 2021 15:01
@nicolasstucki nicolasstucki force-pushed the allow-experimental-imports-in-experimetnal-scopes branch 2 times, most recently from cf1a732 to 1d9e672 Compare August 31, 2021 07:54
odersky and others added 2 commits August 31, 2021 09:56
Also allow top-level experimental language imports if all top-level definitions are experimental
@nicolasstucki nicolasstucki force-pushed the allow-experimental-imports-in-experimetnal-scopes branch from 1d9e672 to 3fb1b6d Compare August 31, 2021 07:57
@nicolasstucki
Copy link
Contributor Author

It is simpler to look at the commits individually, the second only moves documentation.

def check(stable: => String) =
Feature.checkExperimentalFeature("features", imp.srcPos,
s"\n\nNote: the scope enclosing the import is not considered experimental because it contains the\nnon-experimental $stable")
if ctx.owner.is(Package) then
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The main change in this logic is the addition of this condition to detect if we are in a top-level scope.

@dwijnand dwijnand merged commit adefa48 into scala:master Aug 31, 2021
@dwijnand dwijnand deleted the allow-experimental-imports-in-experimetnal-scopes branch August 31, 2021 15:14
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

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.

3 participants