Skip to content

Commit 2afafc9

Browse files
committed
Update Promise; update build
1 parent 4cebbb1 commit 2afafc9

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
@@ -241,7 +241,7 @@ object Build {
241241
"-deprecation",
242242
"-unchecked",
243243
//"-Wconf:cat=deprecation&msg=Unsafe:s", // example usage
244-
// "-Werror",
244+
"-Werror",
245245
//"-Wunused:all",
246246
//"-rewrite", // requires -Werror:false since no rewrites are applied with errors
247247
"-encoding", "UTF8",
@@ -962,6 +962,9 @@ object Build {
962962
}
963963
}.value,
964964

965+
// TODO: Enable fatal warnings after 3.8 because old stdlib has different nullability.
966+
(Compile / scalacOptions) -= "-Werror",
967+
965968
(Test / testOptions) += Tests.Argument(
966969
TestFrameworks.JUnit,
967970
"--exclude-categories=dotty.BootstrappedOnlyTests",
@@ -1797,7 +1800,7 @@ object Build {
17971800
Compile / scalacOptions := Seq("-deprecation", "-feature", "-unchecked", "-encoding", "UTF8", "-language:implicitConversions"),
17981801
Compile / scalacOptions += "-Yno-stdlib-patches",
17991802
Compile / scalacOptions += "-Yexplicit-nulls",
1800-
(Compile / scalacOptions) ++= Seq(
1803+
Compile / scalacOptions ++= Seq(
18011804
// Needed so that the library sources are visible when `dotty.tools.dotc.core.Definitions#init` is called
18021805
"-sourcepath", (Compile / sourceDirectories).value.map(_.getCanonicalPath).distinct.mkString(File.pathSeparator),
18031806
),
@@ -2342,6 +2345,8 @@ object Build {
23422345
// Make sure that the produced artifacts have the minimum JVM version in the bytecode
23432346
Compile / javacOptions ++= Seq("--release", Versions.minimumJVMVersion),
23442347
Compile / scalacOptions ++= Seq("--java-output-version", Versions.minimumJVMVersion),
2348+
// TODO: Enable fatal warnings after 3.8 because old stdlib has different nullability.
2349+
Compile / scalacOptions -= "-Werror",
23452350
// Specify the default entry point of the compiler
23462351
Compile / mainClass := Some("dotty.tools.dotc.Main"),
23472352
// Add entry's to the MANIFEST

0 commit comments

Comments
 (0)