-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Settle on a way to migrate to future language versions #11270
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
Comments
A discussion yesterday gave a slight preference for (2). |
I'm a bit sceptical that the language import would be helpful. If a team is writing some code, a reasonable development strategy would be to always target two compilers, one invoked with a It's also probably a useful constraint (particularly in a larger team) to know that the only way to "enable" new version-level features would be through the command invocation, and that individual team members shouldn't easily do this on a fine-grained basis. And it might also be useful for cross-version testing of new releases of the Scala compiler to encourage a corpus of open-source code that doesn't have different meanings on different compilers. |
There is typically no future compiler. We work with one compiler version only, and that as built in support for things we intend to ship in future versions of the language.
I have seen this argument made many times, but still disagree with it. IMO it's very important that we document what version of Scala we use in the source files themselves. Sort of like pragmas in Haskell. |
We have a use case for language imports in http4s, where due to differences in implicit resolution, the Scala 3 macros need to be compiled with |
Uh oh!
There was an error while loading. Please reload this page.
Current State
Version and migration options are controlled by
-source
, with possible valuesThis can be given as a command line option, as
-source <version>
, or with a language import, as inThe Problem
We are not at all sure whether everything enabled under
-source 3.1
will actually ship in 3.1. We have allowed us great flexibility when to ship new minor versions. 3.1 could happen some months after 3.0 ships and we might still want to enable cross compiling for it, so that many of the deprecations and removals slated for 3.1 would have to wait. So we need a more flexible way to say a feature or deprecation is enabled in a future language version, without being fully precise which one.Constraint
Any proposed solution has to allow controlling version and migration mode from the command line as well as through a language import.
Possible Solutions
3.1
and3.1-migration
to3.x
and3.x-migration
.3.1
and3.1-migration
tofuture
andfutureMigration
. The language import would befuture
and control migration through another language importmigration
. So instead of-source 3.1-migration
it would be-language:future,migration
.This would mean we would also get rid of
3.0-migration
as a separate source version, so instead of-source 3.0-migration
we'd have-source 3.0 -language:migration
. The-source
argument would beredundant as long as default source is 3.0, but would be important if the default source version changed. One could also allow a command line option -migration as a shorthand for
-language:migration
.Which alternative should we choose? Are there others to consider?
The text was updated successfully, but these errors were encountered: