contentful.swift
contentful.swift copied to clipboard
Result ambiguous with Swift.Result
- contentful.swift version number: 5.4.0
- Xcode version number: 12.1
- Target operating system(s) and version number(s)
- [x] iOS:
- [ ] tvOS:
- [ ] watchOS:
- [ ] macOS:
- Package manager:
- [ ] Carthage
- [x] Cocoapods
I have upgraded to 4.2.4 to 5.4.0 , now I am not able to compile , getting following error , could you please help me
client.fetchArray(of: Entry.self, matching: query) { (result: Result<HomogeneousArrayResponse<Entry>>) in
switch result {
case .success(let arrayResponse):
// handle success
case .error:
// Handle error
}
error : Generic type 'Result' specialized with too few type parameters (got 1, but expected 2)
when I try to use Contentful.Result instead of Result , got this error : No type named 'Result' in module 'Contentful'
I got bit by this the other day as well. For what it's worth, I was able to work around the problem by defining the completion closure like so using Swift.Result directly:
client.fetchArray(of: Entry.self) { (result: Result<HomogeneousArrayResponse<Entry>, Error>) in
// ...
}