Skip to content

Commit 7b57e72

Browse files
authored
Merge pull request #13856 from dotty-staging/backport-#13795
Add `scala.language.{3.1, 3.1-migration}`
2 parents 12d87ba + da348cd commit 7b57e72

File tree

6 files changed

+30
-2
lines changed

6 files changed

+30
-2
lines changed

library/src/scala/runtime/stdLibPatches/language.scala

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,33 @@ object language:
148148
@compileTimeOnly("`3.0` can only be used at compile time in import statements")
149149
object `3.0`
150150

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

158158
/** Set source version to 3.1
159159
*
160160
* @see [[https://scalacenter.github.io/scala-3-migration-guide/docs/scala-3-migration-mode]]
161161
*/
162+
@compileTimeOnly("`3.1` can only be used at compile time in import statements")
162163
object `3.1`
164+
165+
/* This can be added when we go to 3.2
166+
/** Set source version to 3.2-migration.
167+
*
168+
* @see [[https://scalacenter.github.io/scala-3-migration-guide/docs/scala-3-migration-mode]]
169+
*/
170+
@compileTimeOnly("`3.2-migration` can only be used at compile time in import statements")
171+
object `3.2-migration`
172+
173+
/** Set source version to 3.2
174+
*
175+
* @see [[https://scalacenter.github.io/scala-3-migration-guide/docs/scala-3-migration-mode]]
176+
*/
177+
@compileTimeOnly("`3.2` can only be used at compile time in import statements")
178+
object `3.2`
163179
*/
164180
end language

project/MiMaFilters.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ import com.typesafe.tools.mima.core.ProblemFilters._
55
object MiMaFilters {
66
val Library: Seq[ProblemFilter] = Seq(
77
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.runtime.Tuples.init"),
8-
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.runtime.Tuples.last")
8+
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.runtime.Tuples.last"),
9+
10+
// Should have been added in 3.1.0
11+
// These are only allowed on imports and therefore should not be present in binaries emitted before
12+
// this addition of these members and therefore should not cause any conflicts.
13+
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.1-migration"),
14+
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.1"),
15+
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E1$"),
16+
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E1$minusmigration$"),
917
)
1018
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import language.`3.0-migration`

tests/pos/source-import-3-0.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import language.`3.0`
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import language.`3.1-migration`

tests/pos/source-import-3-1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import language.`3.1`

0 commit comments

Comments
 (0)