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

Introduce series concept in SourceVersions, add 3.2 to -source (same as 3.0, 3.1) #14629

Closed
wants to merge 3 commits into from

Conversation

bishabosha
Copy link
Member

@bishabosha bishabosha commented Mar 7, 2022

make it more simple to introduce new language versions that enable no extra features (such as 3.1).

Sets default language mode to 3.2 (currently it is semantically identical to 3.0, 3.1).

makes -source compiler flag consistent with scala.language imports

If we enable some features from future by default, such as #14294, then we should revert 83bfea9

@bishabosha
Copy link
Member Author

bishabosha commented Mar 7, 2022

Ideally scala.language.3.1-migration would not have been added to the library, which could simplify the design of mapping from imports to real source versions - now we are basically making it a rule that each minor version should have a "migration" import, even it is a no-op

@smarter smarter added the needs-minor-release This PR cannot be merged until the next minor release label Mar 7, 2022
@smarter
Copy link
Member

smarter commented Mar 7, 2022

Let's hold off on this until today's meeting to decide whether we're actually releasing 3.2.0-RC1 or 3.1.3-RC1 this week.

@michelou
Copy link
Contributor

michelou commented Mar 7, 2022

@smarter +1 for 3.1.3-RC1.

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.

I am not sure about the series concept. That adds another complication to it which is invisible from the version numbers.

I'd recommend to just add the new version number for now, without changing the infrastructure. Make a separate PR if we still think there should be a series concept after discussing it.

@odersky odersky assigned bishabosha and unassigned odersky Mar 7, 2022
@bishabosha
Copy link
Member Author

bishabosha commented Mar 7, 2022

I am not sure about the series concept. That adds another complication to it which is invisible from the version numbers.

I'd recommend to just add the new version number for now, without changing the infrastructure. Make a separate PR if we still think there should be a series concept after discussing it.

I added series due to how Feature.warnOnMigration was implemented (with special logic for migrateTo3 && (version == 3.0 || version == 3.1)) - this was to make that concept apply everywhere, rather than having to remember at each callsite in the compiler that 3.0 and 3.1 are supposed to be the same, which is fragmented.

I'll implement the simplification for now

@bishabosha bishabosha changed the title Add source 3.2 language version Add source 3.2 language version to library, -source options Mar 15, 2022
@bishabosha bishabosha marked this pull request as draft March 15, 2022 11:56
@bishabosha bishabosha force-pushed the allow-3.2 branch 2 times, most recently from a0fc86b to d7f5ee5 Compare March 15, 2022 14:58
@bishabosha bishabosha marked this pull request as ready for review March 15, 2022 15:01
@bishabosha
Copy link
Member Author

rebased after #14690 was merged

@bishabosha bishabosha force-pushed the allow-3.2 branch 2 times, most recently from 803bf26 to 43bc2ba Compare March 15, 2022 15:11
revert this commit if we actually need a 3.2 migration,
i.e. because we enable strict pattern matching
@bishabosha bishabosha changed the title Add source 3.2 language version to library, -source options Introduce series concept in SourceVersions Mar 15, 2022
@bishabosha bishabosha changed the title Introduce series concept in SourceVersions Introduce series concept in SourceVersions, add 3.2 to -source (same as 3.0, 3.1) Mar 15, 2022
@bishabosha bishabosha removed the needs-minor-release This PR cannot be merged until the next minor release label Mar 15, 2022
@bishabosha bishabosha linked an issue Mar 15, 2022 that may be closed by this pull request
@bishabosha
Copy link
Member Author

bishabosha commented Mar 15, 2022

@odersky this PR now introduces the series concept without modifying the library, 3.2 is treated the same as 3.0, 3.1.

  • However to be clear the user could select import language.3.2 and effect migration warnings before wherever the check is that verifies if 3.2 is a member of scala.language (safe as long as 3.2 is in the same series as 3.0)

@bishabosha bishabosha requested a review from odersky March 15, 2022 15:21
@bishabosha
Copy link
Member Author

bishabosha commented Apr 4, 2022

we should instead deprecate the scala.language.3.1-migration object and make it an error to import (e.g. check that there is a corresponding option in the -source flag)

@bishabosha bishabosha closed this Apr 4, 2022
@bishabosha bishabosha deleted the allow-3.2 branch May 8, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants