This is working
basicDelegate!.signUp(_PSRegisterData).then { result in
self.afterSignUpSucceed()
}
This is not and got Missing return in a closure expected to return 'AnyPromise'
basicDelegate!.signUp(_PSRegisterData).then { result in
if result {
self.afterSignUpSucceed()
} else {
self.afterSignUpFailed()
}
}
I think I missing something here, Any hint?
Swift bug. This probably is the solution:
basicDelegate!.signUp(_PSRegisterData).then { result -> Void in
if result {
self.afterSignUpSucceed()
} else {
self.afterSignUpFailed()
}
}
@mxcl Thanks for workaround, working like charm! :D
FFR, this is because Swift was confused about which then to pick (it shouldn't have been). They will fix this or improve the error message, but this category of compile errors will always be around.
The first question at the FAQ is also relevant: http://promisekit.org/faq/
Most helpful comment
Swift bug. This probably is the solution: