I am trying to define an anonymous function that takes in a variable number of arguments.
val a = { (a: Int*) => 1}
The compiler gives the error :')' expected but identifier found
.
For a method I would define a variable number of arguments this way :
def func(a : Int*) : Int =???
And this compiler. Why doesn’t it work for annonymous function?