{"action":"closed","issue":{"url":"https://api.github.com/repos/thoughtbot/Argo/issues/442","repository_url":"https://api.github.com/repos/thoughtbot/Argo","labels_url":"https://api.github.com/repos/thoughtbot/Argo/issues/442/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/Argo/issues/442/comments","events_url":"https://api.github.com/repos/thoughtbot/Argo/issues/442/events","html_url":"https://github.com/thoughtbot/Argo/issues/442","id":198134687,"number":442,"title":"Unable to compile the decode function","user":{"login":"dalu93","id":9826047,"avatar_url":"https://avatars.githubusercontent.com/u/9826047?v=3","gravatar_id":"","url":"https://api.github.com/users/dalu93","html_url":"https://github.com/dalu93","followers_url":"https://api.github.com/users/dalu93/followers","following_url":"https://api.github.com/users/dalu93/following{/other_user}","gists_url":"https://api.github.com/users/dalu93/gists{/gist_id}","starred_url":"https://api.github.com/users/dalu93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalu93/subscriptions","organizations_url":"https://api.github.com/users/dalu93/orgs","repos_url":"https://api.github.com/users/dalu93/repos","events_url":"https://api.github.com/users/dalu93/events{/privacy}","received_events_url":"https://api.github.com/users/dalu93/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-30T11:11:06Z","updated_at":"2016-12-30T11:31:55Z","closed_at":"2016-12-30T11:31:55Z","body":"Hi, I'm currently unable to compile the decode function for an object. Everything works, but, when I add a new json key, I get an error regarding some mismatch with the types expected by the compiler.\r\n\r\n### Error Messages\r\n```\r\nCannot convert value of type (ALL THE TYPES HERE) -> Object to expected argument type (_) -> (_) ...\r\n```\r\n\r\n### Models\r\n\r\nThe model is quite huge and, before you think it's a problem of length, I tried all the possible solutions you wrote here and it ends with the same error.\r\n```swift\r\nextension Object: Decodable {\r\n    \r\n    static func decode(_ json: JSON) -> Decoded<Object> {\r\n        let d = curry(Object.init)\r\n        return d\r\n            <^> (json <|    \"id\") as Decoded<String>\r\n            ... other 19 properties\r\n            <*> (json <|?    \"objectDescription\") as Decoded<String?>\r\n    }\r\n}\r\n```\r\n\r\nWell, if I remove the last row and I remove it from the initializer too, it works. I'm quite sure the type in the initializer is the same I'm using in the `decode` function (`String?`).\r\nHere is the init\r\n```swift\r\ninit(objectId: String, ..., objectDescription: String?) { ... }\r\n```\r\n\r\n### Argo Version\r\n\r\n`4.1.0`\r\n\r\n### Dependency Manager\r\n\r\nCocoapods\r\n"}}
{"actor":{"display_login":"dalu93"}}