Scala is based on the Java virtual machine, which is configured to accept varargs only as the last argument, only one argument for each method. This does not work, so the compiler works.
To imagine this in perspective, imagine this method signature:
someMethod(strings1: String*, strings2: String*)
Let's say you skip 4 separate lines when called. The compiler does not know which String object vararg belongs to.
source
share