I'm trying to get rid of some warnings in my code and can't seem to migrate away from PromiseKit's wrap
. Specifically, in 6.0 the release details say I shouldn't use it and should use init(resolver:)
instead.
I had a function:
func foo(arg1: Int, arg2: Int, completionHandler: @escaping () -> ())
The following was working:
wrap({ foo(arg1: val1, arg2: val2, completionHandler: $0) })
I tried to change it to (what the release notes suggest):
Promise { foo(arg1: val1, arg2: val2, completionHandler: $0.resolve) }
This produced an error Generic parameter 'T' could not be inferred
so I tried to fix that:
Promise<Void> { foo(arg1: val1, arg2: val2, completionHandler: $0.resolve) }
But that triggered a different error Unable to infer closure type in the current context
and I'm not sure where to go from there.