{"action":"opened","issue":{"url":"https://api.github.com/repos/elm-lang/error-message-catalog/issues/68","labels_url":"https://api.github.com/repos/elm-lang/error-message-catalog/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/elm-lang/error-message-catalog/issues/68/comments","events_url":"https://api.github.com/repos/elm-lang/error-message-catalog/issues/68/events","html_url":"https://github.com/elm-lang/error-message-catalog/issues/68","id":120660204,"number":68,"title":"Polymorphic record accessors: expected = actual","user":{"login":"mgold","id":1191970,"avatar_url":"https://avatars.githubusercontent.com/u/1191970?v=3","gravatar_id":"","url":"https://api.github.com/users/mgold","html_url":"https://github.com/mgold","followers_url":"https://api.github.com/users/mgold/followers","following_url":"https://api.github.com/users/mgold/following{/other_user}","gists_url":"https://api.github.com/users/mgold/gists{/gist_id}","starred_url":"https://api.github.com/users/mgold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgold/subscriptions","organizations_url":"https://api.github.com/users/mgold/orgs","repos_url":"https://api.github.com/users/mgold/repos","events_url":"https://api.github.com/users/mgold/events{/privacy}","received_events_url":"https://api.github.com/users/mgold/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-06T21:17:19Z","updated_at":"2015-12-06T21:17:19Z","closed_at":null,"body":"If I define record with polymorphic fields, and then make a list of its `.accessors`, I cannot use those accessors on fields of differing types. Though annoying, this isn't new. However, while previous versions reported a conflict between the two types, 0.16 reports that they are the same type. SSCCE:\r\n\r\n```elm\r\ntype alias Point a =\r\n  {x : a, y : a}\r\n  \r\nints =\r\n  Point 1 2\r\n  \r\nstrings =\r\n  Point \"foo\" \"bar\"\r\n  \r\nfields : List (Point a -> a)\r\nfields =\r\n  [.x, .y]\r\n  \r\npairs =\r\n  List.map\r\n    (\\f -> (f strings, f ints))\r\n    fields\r\n```\r\nThe 0.16 error message is:\r\n\r\n```\r\nThe argument to function `f` is causing a mismatch.\r\n\r\n16|     (\\f -> (f strings, f ints))\r\nFunction `f` is expecting the argument to be:\r\n\r\n    Point String\r\n\r\nBut it is:\r\n\r\n    Point String\r\n```\r\n\r\nI've filed this in the error message catalog since, without adding language features, we can do a better job with this error message and maybe even report that the feature is not available. If others think the SSCCE should be valid, I can escalate to an issue on the compiler."}}