Closed
Description
Minimized code
object Test extends App {
inline def foo(ys: Int*): Unit = Array(ys: _*)
val xs = new Array[Int](3)
foo(xs: _*)
}
fails with
Caused by: java.lang.ClassCastException: [I cannot be cast to scala.collection.Seq
at Test$.<init>(foo.scala:5)
at Test$.<clinit>(foo.scala)
... 7 more
but adding an explicit type to xs
makes it work
val xs: scala.collection.Seq[Int] = new Array[Int](3)
Expectation
The code should work