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
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
10 changes: 9 additions & 1 deletion project/MiMaFilters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import com.typesafe.tools.mima.core.ProblemFilters._
object MiMaFilters {
val Library: Seq[ProblemFilter] = Seq(
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.runtime.Tuples.init"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.runtime.Tuples.last")
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.runtime.Tuples.last"),

// Should have been added in 3.1.0
// These are only allowed on imports 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`