Skip to content

Commit 00f20d3

Browse files
committed
Warn when using -language:Scala2Compat
1 parent 75db82f commit 00f20d3

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
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 // TODO: enable
78+
if Feature.enabledBySetting(nme.Scala2Compat) then
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-
object Scala2Compat
216+
@deprecated object Scala2Compat
217217

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

project/Build.scala

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

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

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

0 commit comments

Comments
 (0)