Skip to content

Commit a7fcb84

Browse files
committed
Adjust build and test flags
1 parent 1d92add commit a7fcb84

9 files changed

Lines changed: 21 additions & 16 deletions

File tree

‎compiler/test/dotty/tools/vulpix/TestConfiguration.scala‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ object TestConfiguration {
6262
Properties.sourcecode
6363
))
6464

65-
lazy val replWithStagingClasspath =
65+
lazy val replWithStagingClasspath =
6666
replClassPath + File.pathSeparator + mkClasspath(List(Properties.dottyStaging))
6767

6868
def mkClasspath(classpaths: List[String]): String =
@@ -101,7 +101,7 @@ object TestConfiguration {
101101
val picklingWithCompilerOptions =
102102
picklingOptions.withClasspath(withCompilerClasspath).withRunClasspath(withCompilerClasspath)
103103

104-
val explicitNullsOptions = defaultOptions `and` "-Yexplicit-nulls"
104+
val explicitNullsOptions = defaultOptions `and` "-language:safeNulls"
105105

106106
/** Default target of the generated class files */
107107
private def defaultTarget: String = "17"

‎project/Build.scala‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ object Build {
189189
"-encoding", "UTF8",
190190
"-language:implicitConversions",
191191
s"--java-output-version:${Versions.minimumJVMVersion}",
192-
"-Yexplicit-nulls",
192+
"-language:safeNulls",
193193
"-Wsafe-init"
194194
),
195195

@@ -1082,13 +1082,14 @@ object Build {
10821082
// Remove Scala 3 specific settings
10831083
scalacOptions --= Seq(
10841084
"--java-output-version:17",
1085-
"-Yexplicit-nulls",
1086-
"-Wsafe-init"
1085+
"-Wsafe-init",
1086+
"-language:safeNulls",
10871087
),
10881088
scalacOptions ++= Seq(
10891089
"-release:17",
10901090
s"-sourcepath:${(Compile / sourceDirectory).value}",
10911091
"-opt:local", // Important: local optimization are fine, inlining is prohibited!
1092+
"-Yno-explicit-nulls",
10921093
),
10931094
target := target.value / "scala2-library",
10941095
Compile / sourceDirectory := (Compile / Keys.target).value / "sources" / scalaVersion.value,
@@ -2117,7 +2118,8 @@ object Build {
21172118
// is a project dependency instead
21182119
excludeDependencies += "org.scala-lang" %% "scala3-library",
21192120
javaOptions := (`scala3-compiler-bootstrapped` / javaOptions).value,
2120-
scalacOptions -= "-Yexplicit-nulls",
2121+
scalacOptions -= "-language:safeNulls",
2122+
scalacOptions += "-Yno-explicit-nulls",
21212123
).
21222124
settings(
21232125
ideTestsCompilerVersion := (`scala3-compiler-nonbootstrapped` / version).value,
@@ -2186,7 +2188,8 @@ object Build {
21862188
settings(
21872189
regularScalaJSProjectSettings,
21882190
bspEnabled := false,
2189-
scalacOptions --= Seq("-Werror", "-deprecation", "-Yexplicit-nulls"),
2191+
scalacOptions --= Seq("-Werror", "-deprecation", "-language:safeNulls"),
2192+
scalacOptions += "-Yno-explicit-nulls",
21902193

21912194
// Required to run Scala.js tests.
21922195
Test / fork := false,
@@ -2481,7 +2484,8 @@ object Build {
24812484
commonBootstrappedSettings,
24822485
scalaJSUseMainModuleInitializer := true,
24832486
Test / fork := false,
2484-
scalacOptions -= "-Yexplicit-nulls",
2487+
scalacOptions -= "-language:safeNulls",
2488+
scalacOptions += "-Yno-explicit-nulls",
24852489
)
24862490

24872491
lazy val `scaladoc-js-contributors` = project.in(file("scaladoc-js/contributors")).
@@ -2564,7 +2568,8 @@ object Build {
25642568
Compile/run := (Compile/run).dependsOn(prepareCommunityBuild).evaluated,
25652569
Test / testOnly := ((Test / testOnly) dependsOn prepareCommunityBuild).evaluated,
25662570
Test / test := ((Test / test ) dependsOn prepareCommunityBuild).value,
2567-
scalacOptions -= "-Yexplicit-nulls",
2571+
scalacOptions -= "-language:safeNulls",
2572+
scalacOptions += "-Yno-explicit-nulls",
25682573
javaOptions ++= {
25692574
// Propagate the ivy cache directory setting to the tests, which will
25702575
// then propagate it further to the sbt instances they will spawn.

‎tests/explicit-nulls/pos/i23936.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//> using options -Yexplicit-nulls
1+
//> using options -language:safeNulls
22

33
sealed abstract class IsSubtypeOfOutput[-A, +B] extends (A => B)
44
object IsSubtypeOfOutput:

‎tests/explicit-nulls/pos/i24440.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//> using options -Yexplicit-nulls -Werror
1+
//> using options -language:safeNulls -Werror
22

33
trait AwtComponentLogging extends java.awt.Component:
44

‎tests/neg-deep-subtype/interop-polytypes.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//> using options -Yexplicit-nulls -Yno-flexible-types
1+
//> using options -language:safeNulls -Yno-flexible-types
22

33
class Foo {
44
import java.util.ArrayList

‎tests/pos/inline-null-wrapper.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//> using options -Yexplicit-nulls
1+
//> using options -language:safeNulls
22
import annotation.targetName
33

44
class A

‎tests/warn/i20132.future-Left.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//> using options -Yexplicit-nulls -Yno-flexible-types
1+
//> using options -Yno-flexible-types
22

33
import scala.language.unsafeNulls
44

‎tests/warn/i20132.stream-Tuple2.safeNulls.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//> using options -Yexplicit-nulls -Yno-flexible-types
1+
//> using options -language:safeNulls -Yno-flexible-types
22

33
import scala.jdk.CollectionConverters.*
44

‎tests/warn/i20132.stream-Tuple2.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//> using options -Yexplicit-nulls -Yno-flexible-types
1+
//> using options -Yno-flexible-types
22

33
// Previously failed because the scrutinee under
44
// unsafeNulls/explicit-nulls/no-flexible-types

0 commit comments

Comments
 (0)