Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result ambiguous with Swift.Result #325

Open
2 of 6 tasks
sarojkumarojha opened this issue Dec 12, 2020 · 1 comment
Open
2 of 6 tasks

Result ambiguous with Swift.Result #325

sarojkumarojha opened this issue Dec 12, 2020 · 1 comment

Comments

@sarojkumarojha
Copy link

  • contentful.swift version number: 5.4.0
  • Xcode version number: 12.1
  • Target operating system(s) and version number(s)
    • iOS:
    • tvOS:
    • watchOS:
    • macOS:
  • Package manager:
    • Carthage
    • 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'

@mbpolan
Copy link

mbpolan commented Jan 6, 2021

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
    // ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants