Consider these methods:
def clearlnOut(coll : Any*)
{
clearOut(coll:_*,"\n") // error
}
def clearOut(coll : Any*)
{
...
The compiler says:
error: no `: _*’ annotation allowed here (such annotations are only allowed in arguments to *-parameters)
Now I am puzzled. It is clear case of using variadic arguments, so how to pass such augmented “collection” properly?
Try this:UPDATE: much better version suggested by @Rex Kerr (see comment below):