-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Compiler version
3.8.0-RC1
Minimized code
import scala.language.experimental.multiSpreads
val xs = List(23,31)
val ys = List(71)
val ints = List(1,2,xs*,3,ys*) // should use VarArgBuilder.ofIntOutput
Note that Int.box is used when calling the add method on the builder
$ scala-cli compile -S 3.8.0-RC1 -d out -Xprint:erasure Foo.scala
@experimental(
"Added by top level \u001b[33mimport \u001b[0mscala.language.experimental.multiSpreads"
) def ints(): scala.collection.immutable.List =
List().apply(
scala.runtime.VarArgsBuilder.ofInt(3 + xs().length() + ys().length()).
add(Int.box(1)).add(Int.box(2)).addSeq(xs()).add(Int.box(3)).addSeq(
ys()).result()
).asInstanceOf[scala.collection.immutable.List]Expectation
VarArgsBuilder.ofX should not produce anonymous classes, therefore the add method can be optimised