Skip to content

Commit f3b2fc2

Browse files
committed
Remove unsafeNulls hack for stdlib migration
1 parent 12bf8c7 commit f3b2fc2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

library/src/scala/IArray.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,13 @@ object IArray:
346346
mapNull(arr, ArraySeq.unsafeWrapArray(arr))
347347

348348
/** Conversion from IArray to immutable.ArraySeq */
349-
import scala.language.unsafeNulls // TODO!!! only for stdlib migration!
350349
implicit def wrapRefArray[T <: AnyRef | Null](arr: IArray[T]): ArraySeq.ofRef[T] =
351350
// Since the JVM thinks arrays are covariant, one 0-length Array[AnyRef | Null]
352351
// is as good as another for all T <: AnyRef | Null. Instead of creating 100,000,000
353352
// unique ones by way of this implicit, let's share one.
354353
mapNull(arr,
355354
if (arr.length == 0) ArraySeq.empty[AnyRef | Null].asInstanceOf[ArraySeq.ofRef[T]]
356-
else ArraySeq.ofRef[AnyRef](arr.asInstanceOf[Array[AnyRef]]).asInstanceOf[ArraySeq.ofRef[T]]
355+
else ArraySeq.ofRef(arr.asInstanceOf[Array[T]])
357356
)
358357

359358
/** Conversion from IArray to immutable.ArraySeq */

0 commit comments

Comments
 (0)