Skip to content

Commit 258d123

Browse files
committed
Use hack to compile scala3-library for now
1 parent ec52238 commit 258d123

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
@@ -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",

0 commit comments

Comments
 (0)