Skip to content

Commit

Permalink
Add 3.7 and 3.7-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaremmal committed Jul 3, 2024
1 parent aad6f7d commit bedb0f8
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
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 @@ -12,6 +12,7 @@ enum SourceVersion:
case `3.4-migration`, `3.4`
case `3.5-migration`, `3.5`
case `3.6-migration`, `3.6`
case `3.7-migration`, `3.7`
// !!! Keep in sync with scala.runtime.stdlibPatches.language !!!
case `future-migration`, `future`

Expand Down
15 changes: 15 additions & 0 deletions library/src/scala/runtime/stdLibPatches/language.scala
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,21 @@ object language:
@compileTimeOnly("`3.6` can only be used at compile time in import statements")
object `3.6`

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

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


// !!! 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`

Expand Down
1 change: 1 addition & 0 deletions tests/pos/source-import-3-7-migration.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import language.`3.7-migration`
1 change: 1 addition & 0 deletions tests/pos/source-import-3-7.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import language.`3.7`

0 comments on commit bedb0f8

Please sign in to comment.