You are passing an array of arrays of Int (Array<Array<Int>>).
Array<Int>, which is [Int], which is Int..., but Int... parameter value can't be an array of [Int], it should be sequence of Ints.
E.g.
func foo(bar: Int...) {
// bar is [Int]
}
foo(0, 3, 13, 6) // parameter is sequence of `Int`s
Also, you could use .map() to apply transform to each element of array. And, using Int type as parameter is not efficient way of writing Swift code (you an not pass Array<UInt> as input parameter, etc.), protocol IntegerArithmeticType provides functions for * operator. All default Swift integer types conform to this protocol. So, the only way here is to use generic function with type T, where T: IntegerArithmeticType. Here is the final code:
let numbers = [2, 3, 5, 2]
/// Multilplies each element of array of `IntegerArithmeticTypes` by `multiplier`.
///
/// - Parameter multiplier: `IntegerArithmeticTypes` multiplier for each element of array.
/// - Parameter vals: Array of `IntegerArithmeticTypes` in which each element
/// will be multiplied by `multiplier`
///
/// - Returns: Array with multiplied values from `values`
public func multipliedMap<T: IntegerArithmeticType>(multiplier: T, _ vals [T]) -> Array<T> {
return vals.map { $0 &* multiplier }
}
dump(multipliedMap(3, numbers))
// prints:
//
// ▿ 4 elements
// - [0]: 6
// - [1]: 9
// - [2]: 15
// - [3]: 6
PS: I used &* operator, because IntegerArithmeticType value may potentially overflow.
number: [Int]...does not mean what you think it does.func num(number: [Int]...)it...