Skip to content

Commit 70d3c56

Browse files
Merge pull request #13797 from dotty-staging/fix-#13773
Add `scala.language.{3.1, 3.1-migration}`
2 parents ad5c714 + 59f410c commit 70d3c56

File tree

6 files changed

+29
-1
lines changed

6 files changed

+29
-1
lines changed

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

+17-1
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://docs.scala-lang.org/scala3/guides/migration/compatibility-intro.html]]
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://docs.scala-lang.org/scala3/guides/migration/compatibility-intro.html]]
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

+8
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,13 @@ object MiMaFilters {
99
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.runtime.Tuples.append"),
1010
ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeReprMethods.substituteTypes"),
1111
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.quoted.Quotes#reflectModule#TypeReprMethods.substituteTypes"),
12+
13+
// Should have been added in 3.1.0
14+
// These are only allowed on imports and therefore should not be present in binaries emitted before
15+
// this addition of these members and therefore should not cause any conflicts.
16+
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.1-migration"),
17+
ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.stdLibPatches.language.3.1"),
18+
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E1$"),
19+
ProblemFilters.exclude[MissingClassProblem]("scala.runtime.stdLibPatches.language$3$u002E1$minusmigration$"),
1220
)
1321
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import language.`3.0-migration`

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

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import language.`3.0`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import language.`3.1-migration`

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

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import language.`3.1`

0 commit comments

Comments
 (0)