Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scala.language.{3.1, 3.1-migration} #13797

Merged
merged 1 commit into from
Nov 1, 2021
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
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 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`