Skip to content

Make SIP-62 better-fors a stable feature #23630

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 2 commits into from
Jul 31, 2025

Conversation

WojciechMazur
Copy link
Contributor

No description provided.

@WojciechMazur WojciechMazur added release-notes Should be mentioned in the release notes needs-minor-release This PR cannot be merged until the next minor release labels Jul 29, 2025
@@ -43,7 +43,7 @@ enum SourceVersion:
def enablesClauseInterleaving = isAtLeast(`3.6`)
def enablesNewGivens = isAtLeast(`3.6`)
def enablesNamedTuples = isAtLeast(`3.7`)
def enablesBetterFors(using Context) = isAtLeast(`3.7`) && isPreviewEnabled
def enablesBetterFors = isAtLeast(`3.8`)
Copy link
Contributor Author

@WojciechMazur WojciechMazur Jul 29, 2025

Choose a reason for hiding this comment

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

I wonder should we also enable it under -source:3.7, -preview - it makes sense to me as well

Suggested change
def enablesBetterFors = isAtLeast(`3.8`)
def enablesBetterFors(using Context) = isAtLeast(`3.8`) || ( isAtLeast(`3.7`) && isPreviewEnabled)

Copy link
Contributor

Choose a reason for hiding this comment

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

makes sense to me, too

@WojciechMazur WojciechMazur merged commit 1f148a1 into scala:main Jul 31, 2025
45 checks passed
@WojciechMazur WojciechMazur deleted the stable/better-fors branch July 31, 2025 07:37
@KacperFKorban
Copy link
Member

@WojciechMazur I think that you may have forgotten to accept your change from #23630 (comment)

KacperFKorban pushed a commit that referenced this pull request Jul 31, 2025
Addendum to #23630 with missing adjustment for older source verisons
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.

3 participants