@@ -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
- " -Wconf:cat=optimizer:is" ,
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" ))
@@ -651,6 +664,7 @@ lazy val scaladoc = configureAsSubproject(project)
651
664
Compile / resourceGenerators += ScaladocSettings .extractResourcesFromWebjar,
652
665
Compile / scalacOptions ++= Seq (
653
666
" -Wconf:cat=deprecation&msg=early initializers:s" ,
667
+ " -Wconf:cat=scala3-migration&msg=early initializers:s" ,
654
668
),
655
669
)
656
670
.dependsOn(compiler)
@@ -666,6 +680,7 @@ lazy val sbtBridge = configureAsSubproject(project, srcdir = Some("sbt-bridge"))
666
680
libraryDependencies += compilerInterfaceDep % Provided ,
667
681
Compile / scalacOptions ++= Seq (
668
682
" -Wconf:cat=deprecation&msg=early initializers:s" , // compiler heavily relies upon early initializers
683
+ " -Wconf:cat=scala3-migration&msg=early initializers:s" , // compiler heavily relies upon early initializers
669
684
),
670
685
generateServiceProviderResources(" xsbti.compile.CompilerInterface2" -> " scala.tools.xsbt.CompilerBridge" ),
671
686
generateServiceProviderResources(" xsbti.compile.ConsoleInterface1" -> " scala.tools.xsbt.ConsoleBridge" ),
@@ -721,6 +736,14 @@ lazy val scalap = configureAsSubproject(project)
721
736
xs filter { x => ! excluded(x.getName) }
722
737
},
723
738
Compile / headerResources := Nil ,
739
+ Compile / scalacOptions ++= Seq (
740
+ " -Xsource:2.13" ,
741
+ " -Xsource-features:-case-apply-copy-access,-case-companion-function,-case-copy-by-name" ,
742
+ " -Xsource-features:-implicit-resolution,-infer-override,-any2stringadd,-unicode-escapes-raw" ,
743
+ " -Xsource-features:-string-context-scope,-leading-infix,-package-prefix-implicits,-double-definitions" ,
744
+ // "-Wconf:cat=scala3-migration&msg=inferred type:s",
745
+ // "-Wconf:cat=scala3-migration&msg=case companion:s",
746
+ ),
724
747
)
725
748
.dependsOn(compiler)
726
749
@@ -735,6 +758,7 @@ lazy val partest = configureAsSubproject(project)
735
758
libraryDependencies ++= List (testInterfaceDep, diffUtilsDep, junitDep),
736
759
Compile / scalacOptions ++= Seq (
737
760
" -Wconf:cat=deprecation&msg=early initializers:s" , // compiler heavily relies upon early initializers
761
+ " -Wconf:cat=scala3-migration&msg=early initializers:s" , // compiler heavily relies upon early initializers
738
762
),
739
763
Compile / javacOptions ++= Seq (" -XDenableSunApiLintControl" , " -Xlint" ) ++
740
764
(if (fatalWarnings.value) Seq (" -Werror" ) else Seq ()),
@@ -807,8 +831,7 @@ lazy val bench = project.in(file("test") / "benchmarks")
807
831
if (benchmarkScalaVersion == " " ) Nil
808
832
else " org.scala-lang" % " scala-compiler" % benchmarkScalaVersion :: Nil
809
833
},
810
- // scalacOptions ++= Seq("-feature", "-opt:inline:scala/**", "-Wopt"),
811
- scalacOptions ++= Seq (" -feature" , " -opt:l:inline" , " -opt-inline-from:scala/**" , " -opt-warnings" ),
834
+ scalacOptions ++= Seq (" -feature" , " -opt:inline:scala/**" , " -Wopt" ),
812
835
// Skips JMH source generators during IDE import to avoid needing to compile scala-library during the import
813
836
// should not be needed once sbt-jmh 0.4.3 is out (https://github.com/sbt/sbt-jmh/pull/207)
814
837
Jmh / bspEnabled := false
@@ -855,6 +878,8 @@ lazy val junit = project.in(file("test") / "junit")
855
878
" -Wconf:msg=match may not be exhaustive:s" , // if we missed a case, all that happens is the test fails
856
879
" -Wconf:cat=lint-nullary-unit&site=.*Test:s" , // normal unit test style
857
880
" -Ypatmat-exhaust-depth" , " 40" , // despite not caring about patmat exhaustiveness, we still get warnings for this
881
+ " -Wconf:cat=deprecation&msg=early initializers:s" ,
882
+ " -Wconf:cat=scala3-migration&msg=early initializers:s" ,
858
883
),
859
884
Compile / javacOptions ++= Seq (" -Xlint" ),
860
885
libraryDependencies ++= Seq (junitInterfaceDep, jolDep, diffUtilsDep, compilerInterfaceDep),
@@ -902,6 +927,7 @@ lazy val tasty = project.in(file("test") / "tasty")
902
927
},
903
928
Compile / scalacOptions ++= Seq (
904
929
" -Wconf:cat=lint-nullary-unit&site=.*Test:s" , // normal unit test style
930
+ raw " -Wconf:cat=optimizer&site=scala\.tools\.nsc\.tasty\.bridge\.TreeOps\.tpd\..*:s " , // inline -> outline
905
931
),
906
932
)
907
933
0 commit comments