Open
Description
Compiler version
3.0.0-RC2 (depending on 2.13.5)
Minimized code
// compile with Scala 2.13.5
package scala2Erasure
class Z {
def stringARRAY_131(x: Array[String with Int]): Unit = {}
}
// compile with 3.0.0-RC2
@main def Test =
val z = new scala2Erasure.Z
z.stringARRAY_131(new Array(10))
Output
Exception in thread "main" java.lang.ClassCastException: [I cannot be cast to [Ljava.lang.String;
at test$package$.Test(test.scala:3)
at Test.main(test.scala:1)
Expectation
maybe error on constructing the array?
Note
The erasure difference is expected because Scala 3 will prioritise primitive classes over reference classes in intersection erasure