-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make better-fors a preview feature in 3.7 #22776
Conversation
6d5b8e8
to
8acfe27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Sorry for the confusion with standard vs preview. I think that I heard at some point that it is supposed to be in preview, but I didn't really know what that means. I just thought that preview doesn't require any options/imports, but just leaves some room for minor changes in the future. (It's useful that there will be a doc page now, and a precedent on how moving to preview should look like)
Just added one question about the error message.
@@ -140,7 +140,7 @@ object language: | |||
* @see [[https://github.com/scala/improvement-proposals/pull/79]] | |||
*/ | |||
@compileTimeOnly("`betterFors` can only be used at compile time in import statements") | |||
@deprecated("The `experimental.betterFors` language import is no longer needed since the feature is now standard", since = "3.7") | |||
@deprecated("The `experimental.betterFors` language import is no longer needed since the feature is now in preview", since = "3.7") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this message direct the user to how the preview feature can be used? I don't think most people know how it works. (I don't fully know how it works. Is there a more fine-grained way to enable preview? Like with a language import?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change to message to give more context
There is no way to enable selectively preview features - you either enable all or none of them. The reasoning for that is the feature is ready, but we (compiler team) don't want yet to want to enforce on us backward binary compatibility. This gives us room for changes, and the users have a sneak peak into next minor to test it out - I assume typically preview period would take 1 minor release cycle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks. Though I meant fine grained scope-wise, not feature-wise. The analogy being language import vs language option.
…ehension test for preview and non-preview mode
Makes the SIP-62 better fors a preview feature in Scala 3.7. Shall be stabilised no earlier then Scala 3.8
Makes the SIP-62 better fors a preview feature in Scala 3.7. Shall be stabilised no earlier then Scala 3.8
Also align betterFors sourceVersion check with #21686
See #22652 (comment)