Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…tors`. (#22238) The `ArrayConstructors` phase rewrites array constructors to calls to `scala.runtime.Arrays.newArray`. When it does that, it must pass the run-time `jl.Class` of the element type. Previously, it used `classOf[Unit]` when creating an `Array[Unit]` (or nested). That is not correct, as from the Java perspective, we need to create `Array[BoxedUnit]`. We now identify `elemType <: Unit` and replace it with `BoxedUnit`. --- This highlights a limitation of the Scala.js backend. We should rewrite calls to `newArray` in the backend to use direct array creation instead.
- Loading branch information