Skip to content

Commit 926393d

Browse files
committed
Use hack to compile scala3-library for now
1 parent 87e29c9 commit 926393d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

library/src/scala/IArray.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,16 @@ object IArray:
353353
* keep this signature to discourage passing nulls implicitly while preserving the
354354
* previous behavior for backward compatibility.
355355
*/
356+
// TODO!!! only for stdliib migration!
357+
import scala.language.unsafeNulls
356358
implicit def wrapRefArray[T <: AnyRef | Null](arr: IArray[T]): ArraySeq.ofRef[T] =
357359
// Since the JVM thinks arrays are covariant, one 0-length Array[AnyRef | Null]
358360
// is as good as another for all T <: AnyRef | Null. Instead of creating 100,000,000
359361
// unique ones by way of this implicit, let's share one.
362+
// import scala.language.unsafeNulls
360363
mapNull(arr,
361364
if (arr.length == 0) ArraySeq.empty[AnyRef | Null].asInstanceOf[ArraySeq.ofRef[T]]
362-
else ArraySeq.ofRef(arr.asInstanceOf[Array[T]])
365+
else ArraySeq.ofRef[AnyRef](arr.asInstanceOf[Array[AnyRef]]).asInstanceOf[ArraySeq.ofRef[T]]
363366
)
364367

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

project/Build.scala

Lines changed: 1 addition & 1 deletion
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",

0 commit comments

Comments
 (0)