{"action":"created","issue":{"url":"https://api.github.com/repos/thoughtbot/Argo/issues/235","labels_url":"https://api.github.com/repos/thoughtbot/Argo/issues/235/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/Argo/issues/235/comments","events_url":"https://api.github.com/repos/thoughtbot/Argo/issues/235/events","html_url":"https://github.com/thoughtbot/Argo/issues/235","id":107609079,"number":235,"title":"Argo 2, large objects, and ambiguous references.","user":{"login":"nomothetis","id":24384,"avatar_url":"https://avatars.githubusercontent.com/u/24384?v=3","gravatar_id":"","url":"https://api.github.com/users/nomothetis","html_url":"https://github.com/nomothetis","followers_url":"https://api.github.com/users/nomothetis/followers","following_url":"https://api.github.com/users/nomothetis/following{/other_user}","gists_url":"https://api.github.com/users/nomothetis/gists{/gist_id}","starred_url":"https://api.github.com/users/nomothetis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomothetis/subscriptions","organizations_url":"https://api.github.com/users/nomothetis/orgs","repos_url":"https://api.github.com/users/nomothetis/repos","events_url":"https://api.github.com/users/nomothetis/events{/privacy}","received_events_url":"https://api.github.com/users/nomothetis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":27,"created_at":"2015-09-21T22:11:59Z","updated_at":"2015-09-23T20:25:01Z","closed_at":null,"body":"An old problem seems to have resurfaced with a new head. We are breaking up large (more than 11 elements) objects into intermediate parts in order to appease the compiler. However, with the migration to Argo 2.0 and Swift 2, the compiler has a new complaint. Take this case (names made neutral):\r\n\r\n```swift\r\npublic static func decode(j: JSON) -> Decoded<DataObject> {\r\n    let firstPart =  DataObject.create\r\n        <^> j <| \"data1\"\r\n        <*> j <| \"data2\"\r\n        <*> j <| \"data3\"\r\n        <*> j <|? \"data4\"\r\n        <*> j <|? \"data5\"\r\n        \r\n    let secondPart = firstPart\r\n        <*> j <|? \"data6\"\r\n        <*> j <|? \"data7\"\r\n        <*> j <|? \"data8\"\r\n        <*> j <|? \"data9\"\r\n        <*> j <|? \"data10\"\r\n        \r\n    let thirdPart = secondPart\r\n        <*> j <|? \"data11\"\r\n        <*> j <|? \"data12\"\r\n        <*> j <|? \"data13\"\r\n        <*> j <|? \"data14\"\r\n        <*> j <|? \"data15\"\r\n            \r\n    let fourthPart = thirdPart\r\n        <*> j <|? \"data16\"\r\n        <*> j <|? \"data17\"\r\n        <*> j <|? \"data18\"\r\n        <*> j <|? \"data19\"\r\n        <*> j <|? \"data20\"\r\n            \r\n    return fourthPart\r\n        <*> j <|? \"data21\"\r\n        <*> j <|? \"data22\"\r\n        <*> j <|? \"data23\"\r\n        <*> j <|| \"data24\"\r\n        <*> j <|| \"data25\"\r\n        <*> j <|| \"data26\"\r\n        <*> j <|? \"data27\"\r\n}\r\n```\r\n\r\nThe compiler complains in two spots (the second line of the `secondPart` assignment and the second line of the `thirdPart` assignment) about an \"Ambiguous reference to member `<|?`\". Does anyone know a way to get around this that doesn't involve breaking up the DataObject itself into multiple smaller objects that then get merged?"},"comment":{"url":"https://api.github.com/repos/thoughtbot/Argo/issues/comments/142718191","html_url":"https://github.com/thoughtbot/Argo/issues/235#issuecomment-142718191","issue_url":"https://api.github.com/repos/thoughtbot/Argo/issues/235","id":142718191,"user":{"login":"amol-c","id":2050256,"avatar_url":"https://avatars.githubusercontent.com/u/2050256?v=3","gravatar_id":"","url":"https://api.github.com/users/amol-c","html_url":"https://github.com/amol-c","followers_url":"https://api.github.com/users/amol-c/followers","following_url":"https://api.github.com/users/amol-c/following{/other_user}","gists_url":"https://api.github.com/users/amol-c/gists{/gist_id}","starred_url":"https://api.github.com/users/amol-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amol-c/subscriptions","organizations_url":"https://api.github.com/users/amol-c/orgs","repos_url":"https://api.github.com/users/amol-c/repos","events_url":"https://api.github.com/users/amol-c/events{/privacy}","received_events_url":"https://api.github.com/users/amol-c/received_events","type":"User","site_admin":false},"created_at":"2015-09-23T20:25:01Z","updated_at":"2015-09-23T20:25:01Z","body":"@tonyd256 Thanks for the above snippet. I had included Argo and Runes, which caused the conflict as you mentioned.\r\nAlso, the above solution worked after breaking down into smaller chunks, my guess is its because of the complex type. I am attaching the code for future reference.\r\n\r\n```\r\n  static func decode(j: JSON) -> Decoded<Product> {\r\n    let firstPart = Product.create\r\n      <^> j <| \"id\"\r\n      <*> j <| \"name\"\r\n      <*> j <| \"rating\"\r\n    let secondPart = firstPart\r\n\r\n      <*> j <|? \"votes\"\r\n      <*> j <| \"author\"\r\n      <*> j <|? \"file\"\r\n    let thirdPart = secondPart\r\n\r\n      <*> j <| \"isFree\"\r\n      <*> j <| \"price\"\r\n      <*> j <|? \"originalPrice\"\r\n      <*> j <|? \"description\"\r\n    let fourthPart = thirdPart\r\n      <*> j <||? \"thumbnails\"\r\n      <*> j <||? \"images\"\r\n      <*> j <||? \"grades\"\r\n    let fifthPart = fourthPart\r\n      <*> j <||? \"subjectAreas\"\r\n      <*> j <||? \"resourceTypes\"\r\n      <*> j <|? \"isPurchased\"\r\n    return fifthPart\r\n      <*> j <|? \"isInWishlist\"\r\n      <*> j <|? \"isInCart\"\r\n      <*> j <|? \"isHardGood\"\r\n  }\r\n```\r\n\r\n"}}