Skip to content

Commit

Permalink
Add `scala.language.{3.1, 3.1-migration}`
Browse files Browse the repository at this point in the history
Fixes #13773
  • Loading branch information
nicolasstucki committed Oct 22, 2021
1 parent 7e06899 commit fe23bae
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 1 deletion.
18 changes: 17 additions & 1 deletion library/src/scala/runtime/stdLibPatches/language.scala
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,33 @@ object language:
@compileTimeOnly("`3.0` can only be used at compile time in import statements")
object `3.0`

/* This can be added when we go to 3.1
/** Set source version to 3.1-migration.
*
* @see [[https://scalacenter.github.io/scala-3-migration-guide/docs/scala-3-migration-mode]]
*/
@compileTimeOnly("`3.1-migration` can only be used at compile time in import statements")
object `3.1-migration`

/** Set source version to 3.1
*
* @see [[https://scalacenter.github.io/scala-3-migration-guide/docs/scala-3-migration-mode]]
*/
@compileTimeOnly("`3.1` can only be used at compile time in import statements")
object `3.1`

/* This can be added when we go to 3.2
/** Set source version to 3.2-migration.
*
* @see [[https://scalacenter.github.io/scala-3-migration-guide/docs/scala-3-migration-mode]]
*/
@compileTimeOnly("`3.2-migration` can only be used at compile time in import statements")
object `3.2-migration`
/** Set source version to 3.2
*
* @see [[https://scalacenter.github.io/scala-3-migration-guide/docs/scala-3-migration-mode]]
*/
@compileTimeOnly("`3.2` can only be used at compile time in import statements")
object `3.2`
*/
end language
8 changes: 8 additions & 0 deletions project/MiMaFilters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,13 @@ object MiMaFilters {
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.runtime.Tuples.append"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeReprMethods.substituteTypes"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeReprMethods.substituteTypes"),

// Should have been added in 3.1.0
// These are `@compileTimeOnly` and therefore should not be present in binaries emitted before
// this addition of these members and therefore should not cause any conflicts.
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.1-migration"),
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.1"),
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E1$"),
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E1$minusmigration$"),
)
}
1 change: 1 addition & 0 deletions tests/pos/source-import-3-0-migration.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import language.`3.0-migration`
1 change: 1 addition & 0 deletions tests/pos/source-import-3-0.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import language.`3.0`
1 change: 1 addition & 0 deletions tests/pos/source-import-3-1-migration.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import language.`3.1-migration`
1 change: 1 addition & 0 deletions tests/pos/source-import-3-1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import language.`3.1`

0 comments on commit fe23bae

Please sign in to comment.