I'm learning Swift. Below is my code:
enum MyTest
{
case Point(Int, Int)
case What(String)
case GiveMeFunc((array: Int...) -> Int)
}
var p1 = MyTest.Point(2, 2)
var p2 = MyTest.Point(3, 3)
var s1 = MyTest.What("Haha...")
var s2 = MyTest.What("Heihei...")
var f1 = MyTest.GiveMeFunc({(array: Int...) -> Int in return 8})
var f2 = MyTest.GiveMeFunc({(array: Int...) -> Int in return 9})
switch p1 {
case .What(let string):
println(string)
case .GiveMeFunc(let f):
println(f(1, 2, 4, 3))
case .Point(let a, let b):
println("a: \(a) b: \(b)")
}
When I run it I got
missing argument label 'array' in call.
The error comes from :
println(f(1, 2, 4, 3))`
How to fix the error?