just writing a simple swift app and this error came up.
protocol FormDelegate {
func formDidFinish(form: Form)
}
class Form {
var delegate: FormDelegate?
func testClosure(sender: () -> Void) {
}
}
let form = Form()
form.testClosure {
// let removeCommentToGetRidOfError = true
form.delegate?.formDidFinish(form) // error: Cannot convert the expression's type '() -> () -> $T2' to type '()'
}
but when i insert the let statement, everything works. Any clue what's going on?