Skip to content

Commit f29fdae

Browse files
committed
fix regression where Array[Unit].empty caused NPE
this regressed in scala/scala#9091 the problem turned up in the Scala 2.12 community build -- when Scala 3 support was added to the scala-collection-compat repo, a test case there was altered in a way that happened to tickle this
1 parent 809f801 commit f29fdae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/src/scala/reflect/ClassTag.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ trait ClassTag[T] extends ClassManifestDeprecatedApis[T] with Equals with Serial
5353

5454
@transient private[scala] lazy val emptyArray : Array[T] = {
5555
val componentType =
56-
if (runtimeClass eq classOf[Void]) classOf[BoxedUnit] else runtimeClass
56+
if (runtimeClass eq java.lang.Void.TYPE) classOf[BoxedUnit] else runtimeClass
5757
java.lang.reflect.Array.newInstance(componentType, 0).asInstanceOf[Array[T]]
5858
}
5959
@transient private[scala] lazy val emptyWrappedArray: mutable.WrappedArray[T] =

0 commit comments

Comments
 (0)