只是写一个简单的
swift应用程序,这个错误出现了.
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 '()' }
但是当我插入let语句时,一切正常.有什么想法发生了什么?