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

Make better-fors a preview feature in 3.7 #22776

Merged
merged 5 commits into from
Mar 12, 2025

Conversation

WojciechMazur
Copy link
Contributor

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)

@WojciechMazur WojciechMazur changed the title Make better-fors a preview feature Make better-fors a preview feature in 3.7 Mar 11, 2025
@WojciechMazur WojciechMazur added the backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. label Mar 11, 2025
@WojciechMazur WojciechMazur added this to the 3.7.0 milestone Mar 11, 2025
Copy link
Member

@KacperFKorban KacperFKorban left a 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")
Copy link
Member

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?)

Copy link
Contributor Author

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.

Copy link
Member

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.

@WojciechMazur WojciechMazur enabled auto-merge (squash) March 11, 2025 19:59
@WojciechMazur WojciechMazur added the release-notes Should be mentioned in the release notes label Mar 11, 2025
@WojciechMazur WojciechMazur merged commit 3fe9304 into scala:main Mar 12, 2025
28 of 29 checks passed
@WojciechMazur WojciechMazur deleted the preview/better-fors branch March 12, 2025 10:57
WojciechMazur added a commit that referenced this pull request Mar 12, 2025
Makes the SIP-62 better fors a preview feature in Scala 3.7. Shall be
stabilised no earlier then Scala 3.8
@WojciechMazur WojciechMazur added backport:done This PR was successfully backported. and removed backport:nominated If we agree to backport this PR, replace this tag with "backport:accepted", otherwise delete it. labels Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:done This PR was successfully backported. release-notes Should be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants