Since I upgraded to Swift 1.2, I have this weird problem, that I cannot resolve. Here is the code that causes all the trouble:
internal class Test<T,U> {
internal class func closureFunc(#arg: T, worker: (first: T, second: String) -> U, closure: ((u: U) -> Void)?) -> Void {
println("Something")
}
}
Test.closureFunc(arg: "", worker: { (first, second) -> Void in
//code
}) { (u) -> Void in
//code
}
The error itself says:
"Function signature (Void) -> Void is not compatible with expected type (u: Void) -> Void".
I read all about Swift 1.2 and I still can't seem to find a reasonable explanation for this. I will be extremely thankful for any tips and suggestions.
PS: I just saw this topic, that is similar to mine but removing the parameter name in the closure didn't quite work for me.