Skip to content

Commit c3e9cd2

Browse files
committed
Revert "Warn when using -language:Scala2Compat"
This reverts commit bd874df.
1 parent bf60b67 commit c3e9cd2

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

compiler/src/dotty/tools/dotc/Driver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class Driver {
7575
inContext(ictx) {
7676
if !ctx.settings.YdropComments.value || ctx.mode.is(Mode.ReadComments) then
7777
ictx.setProperty(ContextDoc, new ContextDocstrings)
78-
if Feature.enabledBySetting(nme.Scala2Compat) && false then // enable when -language:Scala2compat has been purged from the builds
78+
if Feature.enabledBySetting(nme.Scala2Compat) && false then // TODO: enable
7979
ctx.warning("-language:Scala2Compat will go away; use -source 3.0-migration instead")
8080
val fileNames = CompilerCommand.checkUsage(summary, sourcesRequired)
8181
fromTastySetup(fileNames, ctx)

library/src/scalaShadowing/language.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ object language {
213213
}
214214

215215
/** Where imported, a backwards compatibility mode for Scala2 is enabled */
216-
@deprecated object Scala2Compat
216+
object Scala2Compat
217217

218218
/** Where imported, auto-tupling is disabled */
219219
object noAutoTupling

project/Build.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,10 @@ object Build {
783783
)
784784

785785
lazy val tastyCoreSettings = Seq(
786-
scalacOptions ~= (_ :+ "-source:3.0-migration")
786+
scalacOptions ~= { old =>
787+
val (language, other) = old.partition(_.startsWith("-language:"))
788+
other :+ (language.headOption.map(_ + ",Scala2Compat").getOrElse("-source:3.0-migration"))
789+
}
787790
)
788791

789792
lazy val `tasty-core` = project.in(file("tasty")).asTastyCore(NonBootstrapped)

sbt-dotty/sbt-test/source-dependencies/java-analysis-serialization-error/project/DottyInjectedPlugin.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ object DottyInjectedPlugin extends AutoPlugin {
77

88
override val projectSettings = Seq(
99
scalaVersion := sys.props("plugin.scalaVersion"),
10-
scalacOptions += "-source:3.0-migration"
10+
scalacOptions += "-language:Scala2CompatCompat"
1111
)
1212
}

0 commit comments

Comments
 (0)