Using varargs from Scala
问题 I'm tearing my hair out trying to figure out how to do the following: def foo(msf: String, o: Any, os: Any*) = { println( String.format(msf, o :: List(os:_*)) ) } There's a reason why I have to declare the method with an o and an os Seq separately. Basically, I end up with the format method called with a single object parameter (of type List ). Attempting: def foo(msf: String, o: Any, os: Any*) = { println( String.format(msf, (o :: List(os:_*))).toArray ) } Gives me the type error: found: