Closed akellyak47 closed 4 years ago
Hi @akellyak47,
Please try the following:
Promise(on: .global()) { () -> PlaceDetailResponse in
print("hello")
return try await(GoogleMapsHTTPClient.getPlaceDetails(placeID: placeID))
}.then {
print($0.name)
}
Hey @shoumikhin,
Thanks for the response. That worked like a charm. As a note, I had to specify <PlaceDetailResponse>
after Promise
to remove the following error: "Ambiguous reference to member 'then(on:_:)'". I'm guessing that's a shortcoming with Swift's type inference.
Hello,
I'm experiencing some peculiar compiler-related issues.
This example compiles/runs as expected:
However, if I insert any code (e.g. a print statement) above the above return my code fails to compile with the following error: "Contextual type for closure argument list expects 2 arguments, which cannot be implicitly ignored"
If I take Xcode's suggestion of adding
_,_ in
I get a new error message: "Unexpected non-void return value in void function"Am I missing something obvious here?