Skip to content

Commit 6ac84c3

Browse files
committed
Update Promise; update build
1 parent d5d9729 commit 6ac84c3

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

library/src/scala/concurrent/impl/Promise.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ private[concurrent] object Promise {
274274

275275
override final def isCompleted: Boolean = value0 ne null
276276

277-
override final def value: Option[Try[T]] = Option(value0).asInstanceOf[Option[Try[T]]]
277+
override final def value: Option[Try[T]] = Option(value0)
278278

279279
@tailrec // returns null if not completed
280280
private final def value0: Try[T] | Null = {

library/src/scala/reflect/ClassManifestDeprecatedApis.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ trait ClassManifestDeprecatedApis[T] extends OptManifest[T] {
3232
def loop(left: Set[jClass[_]], seen: Set[jClass[_]]): Boolean = {
3333
left.nonEmpty && {
3434
val next = left.head
35-
val supers = next.getInterfaces.nn.toSet ++ Option(next.getSuperclass)
35+
val supers = next.getInterfaces.toSet ++ Option(next.getSuperclass)
3636
supers(sup) || {
3737
val xs = left ++ supers filterNot seen
3838
loop(xs - next, seen + next)
@@ -137,6 +137,7 @@ trait ClassManifestDeprecatedApis[T] extends OptManifest[T] {
137137

138138
protected def argString =
139139
if (typeArguments.nonEmpty) typeArguments.mkString("[", ", ", "]")
140+
// TODO: remove .nn here after 3.8. See #24070
140141
else if (runtimeClass.isArray) "["+ClassManifest.fromClass(runtimeClass.getComponentType.nn)+"]"
141142
else ""
142143
}

project/Build.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ object Build {
238238
"-deprecation",
239239
"-unchecked",
240240
//"-Wconf:cat=deprecation&msg=Unsafe:s", // example usage
241-
// "-Werror",
241+
"-Werror",
242242
//"-Wunused:all",
243243
//"-rewrite", // requires -Werror:false since no rewrites are applied with errors
244244
"-encoding", "UTF8",
@@ -956,6 +956,9 @@ object Build {
956956
}
957957
}.value,
958958

959+
// TODO: Enable fatal warnings after 3.8 because old stdlib has different nullability.
960+
(Compile / scalacOptions) -= "-Werror",
961+
959962
(Test / testOptions) += Tests.Argument(
960963
TestFrameworks.JUnit,
961964
"--exclude-categories=dotty.BootstrappedOnlyTests",
@@ -1764,7 +1767,7 @@ object Build {
17641767
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
17651768
Compile / scalacOptions += "-Yno-stdlib-patches",
17661769
Compile / scalacOptions += "-Yexplicit-nulls",
1767-
(Compile / scalacOptions) ++= Seq(
1770+
Compile / scalacOptions ++= Seq(
17681771
// Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called
17691772
"-sourcepath", (Compile / sourceDirectories).value.map(_.getCanonicalPath).distinct.mkString(File.pathSeparator),
17701773
),
@@ -2290,6 +2293,8 @@ object Build {
22902293
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
22912294
Compile / javacOptions ++= Seq("--release", Versions.minimumJVMVersion),
22922295
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
2296+
// TODO: Enable fatal warnings after 3.8 because old stdlib has different nullability.
2297+
Compile / scalacOptions -= "-Werror",
22932298
// Specify the default entry point of the compiler
22942299
Compile / mainClass := Some("dotty.tools.dotc.Main"),
22952300
// Add entry's to the MANIFEST

0 commit comments

Comments
 (0)