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

Xcode 11.2.1 Binary operator '<^>' cannot be applied to operands of type #499

Closed
MervinFlores opened this issue Nov 17, 2019 · 7 comments
Closed

Comments

@MervinFlores
Copy link

MervinFlores commented Nov 17, 2019

I has the follow code implemented to work with Argo framework, has been working until the Xcode 11.2.1 update. when I updated my Xcode Version the follow error appears:

Error Messages

Binary operator '<^>' cannot be applied to operands of type '(()) -> VoiceMailNumberResponse' and 'Decoded<_?>'

Models

Here's my code:

struct VoiceMailNumberResponse{
    var name: String?
    var value: String?
}

extension VoiceMailNumberResponse: Argo.Decodable {
    static func decode(_ json: JSON) -> Decoded<VoiceMailNumberResponse> {
        let voiceMailNumberResponse = curry(VoiceMailNumberResponse.init)
        return voiceMailNumberResponse
            <^> json <|?  "name"
            <*> json <|?  "value"
    }
}

Error appears on line:

"<^> json <|?  "name"

In addition I'm using Argo, Curry and Runes for parsing JSON.

Argo Version

Argo 4.2.0

Dependency Manager

Cocoapods

@dahuanghuang
Copy link

I have similar errors in my project

@gfontenot
Copy link
Collaborator

It sounds like something changed with precedence or type inference. I don't have much time to dig into this right now, but if someone wants to look into this I'm happy to help however I can.

@gfontenot
Copy link
Collaborator

Oh it might also be something that changed with the type of the initializer? That type signature implies that the curried initializer doesn't take any arguments.

@dahuanghuang
Copy link

This error is accompanied by a hint

Messages

"1. Overloads for '<^>' exist with these partially matching parameter lists: ((T) -> U, Decoded), ((T) -> U, Result<T, E>), ((T) -> U, T?), ((T) -> U, [T])"

@MervinFlores
Copy link
Author

@gfontenot
Copy link
Collaborator

Makes sense, although it's unfortunate. I assume the other way to fix this would be to define an explicit initializer, which would keep Swift for synthesizing them for you.

@gfontenot
Copy link
Collaborator

I'm going to go ahead and close this due to inactivity but please feel free to reopen if this is still an issue.

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

3 participants