Skip to content

Settle on a way to migrate to future language versions #11270

Closed
@odersky

Description

@odersky

Current State

Version and migration options are controlled by -source, with possible values

3.0-migration, 3.0, 3.1-migration, 3.1

This can be given as a command line option, as -source <version>, or with a language import, as in

import language.`3.1`

The 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

  1. Keep the current scheme, but rename 3.1 and 3.1-migration to 3.x and 3.x-migration.
  2. Keep the current scheme but rename 3.1 and 3.1-migration to future and futureMigration. The language import would be
    import language.future
    import language.futureMigration
  3. Replace future source versions by a language import future and control migration through another language import migration. So instead of
    import language.`3.1-migration`
    it would be
    import language.{future, migration}
    and 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 be
    redundant 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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions