Say I have a function
def f(a:Int = 0, b:String = "", c:Float=0.0, foos: Foo*) { ... }
Note the use of default arguments for some parameters. Typically, to use the default values, you call a function with named parameters, for example:
val foo = Foo("Foo!") f(foos = foo)
This syntax works because I only call a method with one foo . However, if I have two or more
val foo1 = Foo("Foo!") val foo2 = Foo("Bar!") f(foos = ...)
It is not so obvious what to feed here. Seq(foo1,foo2) and Seq(foo1,foo2):_* do not print the check.
What else, how can I call it with no foo s?
// All out of foos! f(foos = ...)
In this case, calling a function with empty brackets ( f() ) does not work.
Thanks!
source share