Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/config/SourceVersion.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ enum SourceVersion:
case `3.2-migration`, `3.2`
case `3.3-migration`, `3.3`
case `3.4-migration`, `3.4`
// !!! Keep in sync with scala.runtime.stdlibPatches.language !!!
case `future-migration`, `future`

val isMigrating: Boolean = toString.endsWith("-migration")
Expand Down
17 changes: 17 additions & 0 deletions library/src/scala/runtime/stdLibPatches/language.scala
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,21 @@ object language:
@compileTimeOnly("`3.3` can only be used at compile time in import statements")
object `3.3`

/** Set source version to 3.4-migration.
*
* @see [[https://docs.scala-lang.org/scala3/guides/migration/compatibility-intro.html]]
*/
@compileTimeOnly("`3.4-migration` can only be used at compile time in import statements")
object `3.4-migration`

/** Set source version to 3.4
*
* @see [[https://docs.scala-lang.org/scala3/guides/migration/compatibility-intro.html]]
*/
@compileTimeOnly("`3.4` can only be used at compile time in import statements")
object `3.4`

// !!! Keep in sync with dotty.tools.dotc.config.SourceVersion !!!
// Also add tests in `tests/pos/source-import-3-x.scala` and `tests/pos/source-import-3-x-migration.scala`

end language
1 change: 1 addition & 0 deletions tests/pos/source-import-3-3-migration.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import language.`3.3-migration`
1 change: 1 addition & 0 deletions tests/pos/source-import-3-3.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import language.`3.3`
1 change: 1 addition & 0 deletions tests/pos/source-import-3-4-migration.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import language.`3.4-migration`
1 change: 1 addition & 0 deletions tests/pos/source-import-3-4.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import language.`3.4`