@@ -196,14 +196,15 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories
196
196
cleanFiles+= (Compile / doc/ target).value,
197
197
run/ fork:= true ,
198
198
run/ connectInput:= true ,
199
- Compile / scalacOptions++= Seq (" -feature" ," -Xlint " ,
199
+ Compile / scalacOptions++= Seq (" -Xlint " , " - feature" ," -Xsource:3-cross " ,
200
200
// "-Vprint",
201
201
// "-Xmaxerrs", "5", "-Xmaxwarns", "5", // uncomment for ease of development while breaking things
202
202
// work around https://github.com/scala/bug/issues/11534
203
203
" -Wconf:cat=unchecked&msg=The outer reference in this type test cannot be checked at run time.:s" ,
204
204
// optimizer warnings at INFO since `-Werror` may be turned on.
205
205
// optimizer runs in CI and release builds, though not in local development.
206
206
" -Wconf:cat=optimizer:is" ,
207
+ // "-Wopt",
207
208
// we use @nowarn for methods that are deprecated in JDK > 8, but CI/release is under JDK 8
208
209
" -Wconf:cat=unused-nowarn:s" ,
209
210
" -Wunnamed-boolean-literal-strict" ,
@@ -450,6 +451,10 @@ lazy val library = configureAsSubproject(project)
450
451
name:= " scala-library" ,
451
452
description:= " Scala Standard Library" ,
452
453
Compile / scalacOptions++= Seq (" -sourcepath" , (Compile / scalaSource).value.toString),
454
+ Compile / scalacOptions++= Seq (" -Xsource-features:-case-companion-function" ),
455
+ Compile / scalacOptions++= Seq (" -Wconf:cat=scala3-migration&msg=elidable&site=scala.Predef:s" ),
456
+ // Compile / scalacOptions ++= Seq("-Wconf:msg=Synthetic case companion&src=src/library/scala/jdk/FunctionWrappers.scala:s"),
457
+ // Compile / scalacOptions ++= Seq("-Wconf:cat=scala3-migration&msg=constructor modifiers&site=scala.concurrent.duration.Deadline:s"), // for bootstrap until restarr
453
458
Compile / doc/ scalacOptions++= {
454
459
val libraryAuxDir = (ThisBuild / baseDirectory).value/ " src/library-aux"
455
460
Seq (
@@ -502,6 +507,7 @@ lazy val reflect = configureAsSubproject(project)
502
507
Osgi .bundleName:= " Scala Reflect" ,
503
508
Compile / scalacOptions++= Seq (
504
509
" -Wconf:cat=deprecation&msg=early initializers:s" ,// compiler heavily relies upon early initializers
510
+ " -Wconf:cat=scala3-migration&msg=early initializers:s" ,// compiler heavily relies upon early initializers
505
511
),
506
512
Compile / doc/ scalacOptions++= Seq (
507
513
" -skip-packages" ," scala.reflect.macros.internal:scala.reflect.internal:scala.reflect.io"
@@ -576,6 +582,7 @@ lazy val compiler = configureAsSubproject(project)
576
582
Compile / scalacOptions++= Seq (
577
583
// "-Wunused", //"-Wnonunit-statement",
578
584
" -Wconf:cat=deprecation&msg=early initializers:s" ,// compiler heavily relies upon early initializers
585
+ " -Wconf:cat=scala3-migration&msg=early initializers:s" ,// compiler heavily relies upon early initializers
579
586
),
580
587
Compile / doc/ scalacOptions++= Seq (
581
588
" -doc-root-content" , (Compile / sourceDirectory).value+ " /rootdoc.txt"
@@ -614,15 +621,21 @@ lazy val interactive = configureAsSubproject(project)
614
621
.settings(
615
622
name:= " scala-compiler-interactive" ,
616
623
description:= " Scala Interactive Compiler" ,
617
- Compile / scalacOptions++= Seq (" -Wconf:cat=deprecation&msg=early initializers:s" ),
624
+ Compile / scalacOptions++= Seq (
625
+ " -Wconf:cat=deprecation&msg=early initializers:s" ,
626
+ " -Wconf:cat=scala3-migration&msg=early initializers:s" ,// compiler heavily relies upon early initializers
627
+ )
618
628
)
619
629
.dependsOn(compiler)
620
630
621
631
lazy val repl = configureAsSubproject(project)
622
632
.settings(disableDocs)
623
633
.settings(fatalWarningsSettings)
624
634
.settings(publish/ skip:= true )
625
- .settings(Compile / scalacOptions++= Seq (" -Wconf:cat=deprecation&msg=early initializers:s" ))
635
+ .settings(Compile / scalacOptions++= Seq (
636
+ " -Wconf:cat=deprecation&msg=early initializers:s" ,
637
+ " -Wconf:cat=scala3-migration&msg=early initializers:s" ,
638
+ ))
626
639
.dependsOn(compiler, interactive)
627
640
628
641
lazy val replFrontend = configureAsSubproject(project, srcdir= Some (" repl-frontend" ))
@@ -652,6 +665,7 @@ lazy val scaladoc = configureAsSubproject(project)
652
665
Compile / resourceGenerators+= ScaladocSettings .extractResourcesFromWebjar,
653
666
Compile / scalacOptions++= Seq (
654
667
" -Wconf:cat=deprecation&msg=early initializers:s" ,
668
+ " -Wconf:cat=scala3-migration&msg=early initializers:s" ,
655
669
),
656
670
)
657
671
.dependsOn(compiler)
@@ -667,6 +681,7 @@ lazy val sbtBridge = configureAsSubproject(project, srcdir = Some("sbt-bridge"))
667
681
libraryDependencies+= compilerInterfaceDep% Provided ,
668
682
Compile / scalacOptions++= Seq (
669
683
" -Wconf:cat=deprecation&msg=early initializers:s" ,// compiler heavily relies upon early initializers
684
+ " -Wconf:cat=scala3-migration&msg=early initializers:s" ,// compiler heavily relies upon early initializers
670
685
),
671
686
generateServiceProviderResources(" xsbti.compile.CompilerInterface2" -> " scala.tools.xsbt.CompilerBridge" ),
672
687
generateServiceProviderResources(" xsbti.compile.ConsoleInterface1" -> " scala.tools.xsbt.ConsoleBridge" ),
@@ -722,6 +737,12 @@ lazy val scalap = configureAsSubproject(project)
722
737
xs filter { x=> ! excluded(x.getName) }
723
738
},
724
739
Compile / headerResources:= Nil ,
740
+ Compile / scalacOptions++= Seq (
741
+ " -Xsource:2.13" ,
742
+ // "-Xsource-features:-case-companion-function,-implicit-resolution,-infer-override,-package-prefix-implicits",
743
+ // "-Wconf:cat=scala3-migration&msg=inferred type:s",
744
+ // "-Wconf:cat=scala3-migration&msg=case companion:s",
745
+ ),
725
746
)
726
747
.dependsOn(compiler)
727
748
@@ -736,6 +757,7 @@ lazy val partest = configureAsSubproject(project)
736
757
libraryDependencies++= List (testInterfaceDep, diffUtilsDep, junitDep),
737
758
Compile / scalacOptions++= Seq (
738
759
" -Wconf:cat=deprecation&msg=early initializers:s" ,// compiler heavily relies upon early initializers
760
+ " -Wconf:cat=scala3-migration&msg=early initializers:s" ,// compiler heavily relies upon early initializers
739
761
),
740
762
Compile / javacOptions++= Seq (" -XDenableSunApiLintControl" ," -Xlint" )++
741
763
(if (fatalWarnings.value)Seq (" -Werror" )else Seq ()),
@@ -808,8 +830,7 @@ lazy val bench = project.in(file("test") / "benchmarks")
808
830
if (benchmarkScalaVersion== " " )Nil
809
831
else " org.scala-lang" % " scala-compiler" % benchmarkScalaVersion:: Nil
810
832
},
811
- // scalacOptions ++= Seq("-feature", "-opt:inline:scala/**", "-Wopt"),
812
- scalacOptions++= Seq (" -feature" ," -opt:l:inline" ," -opt-inline-from:scala/**" ," -opt-warnings" ),
833
+ scalacOptions++= Seq (" -feature" ," -opt:inline:scala/**" ," -Wopt" ),
813
834
// Skips JMH source generators during IDE import to avoid needing to compile scala-library during the import
814
835
// should not be needed once sbt-jmh 0.4.3 is out (https://github.com/sbt/sbt-jmh/pull/207)
815
836
Jmh / bspEnabled:= false
@@ -856,6 +877,8 @@ lazy val junit = project.in(file("test") / "junit")
856
877
" -Wconf:msg=match may not be exhaustive:s" ,// if we missed a case, all that happens is the test fails
857
878
" -Wconf:cat=lint-nullary-unit&site=.*Test:s" ,// normal unit test style
858
879
" -Ypatmat-exhaust-depth" ," 40" ,// despite not caring about patmat exhaustiveness, we still get warnings for this
880
+ " -Wconf:cat=deprecation&msg=early initializers:s" ,
881
+ " -Wconf:cat=scala3-migration&msg=early initializers:s" ,
859
882
),
860
883
Compile / javacOptions++= Seq (" -Xlint" ),
861
884
libraryDependencies++= Seq (junitInterfaceDep, jolDep, diffUtilsDep, compilerInterfaceDep),