Just started with PromiseKit and running into a weird compile problem:
- with firstly: Ambiguous reference to member 'firstly(execute:)' ()
- without firstly: Unable to infer complex closure return type; add explicit
Not sure what I am doing wrong here.
Promise
func test(someValue: Int) -> Promise<Void> {
return Promise { seal in
// do something with someValue
seal.fulfill(())
}
}
This works:
firstly {
test(someValue: 2)
}.then {
test(someValue: 1)
}.catch { error in
...
}
but this one doesn't:
firstly {
test(someValue: 2)
}.then {
let dd = 1
return test(someValue: dd)
}.catch { error in
...
}