Closed
Description
Compiler version
3.0.0-M4-bin-20210214-80befc3-NIGHTLY
Minimized code
(from docs on unified varargs syntax)
val arr = Array(1, 2, 3)
val lst = List(0, arr*) // vararg splice argument
lst match {
case List(0, 1, xs*) => println(xs) // binds xs to Seq(2, 3)
case List(1, _*) => // wildcard pattern
}
Output (click arrow to expand)
[error] (run-main-0) java.lang.ClassCastException: [I cannot be cast to scala.collection.immutable.Seq
[error] java.lang.ClassCastException: [I cannot be cast to scala.collection.immutable.Seq
[error] at Main$.main(Main.scala:8)
[error] at Main.main(Main.scala)
[error] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.lang.reflect.Method.invoke(Method.java:498)
It is simple main with code above. Also tried in dotty REPL built from master - same exception.