Variadic Parameter
// โญ๏ธ variadic parameter
func f1(_ ints: Int...) -> Int { return 1 }
func f2(_ ints: Int...) -> Int { // `ints` is of type `[Int]`
// โ cannot convert value of type '[Int]'
// to expected argument type 'Int'
return f1(ints)
}
// The only way to solve this (for now) is to add
// another method overload accepting an array
Last updated
Was this helpful?