個々の引数を vararg 関数に渡すことが可能であり、seq を使用して渡すことが可能であることは知っていますが、:_*
両方を渡すことは可能ですか?
例えば:
scala> object X { def y(s: String*) = println(s) }
defined module X
scala> X.y("a", "b", "c")
WrappedArray(a, b, c)
scala> X.y(Seq("a", "b", "c"):_*)
List(a, b, c)
scala> X.y("a", Seq("b", "c"):_*)
<console>:9: error: no `: _*' annotation allowed here
(such annotations are only allowed in arguments to *-parameters)
X.y("a", Seq("b", "c"):_*)
^
編集: Scala 2.10で(重要な場合)