{"action":"closed","issue":{"url":"https://api.github.com/repos/leanprover/lean/issues/794","labels_url":"https://api.github.com/repos/leanprover/lean/issues/794/labels{/name}","comments_url":"https://api.github.com/repos/leanprover/lean/issues/794/comments","events_url":"https://api.github.com/repos/leanprover/lean/issues/794/events","html_url":"https://github.com/leanprover/lean/issues/794","id":100832138,"number":794,"title":"Error message for level-param mismatch in coercion","user":{"login":"dselsam","id":4520285,"avatar_url":"https://avatars.githubusercontent.com/u/4520285?v=3","gravatar_id":"","url":"https://api.github.com/users/dselsam","html_url":"https://github.com/dselsam","followers_url":"https://api.github.com/users/dselsam/followers","following_url":"https://api.github.com/users/dselsam/following{/other_user}","gists_url":"https://api.github.com/users/dselsam/gists{/gist_id}","starred_url":"https://api.github.com/users/dselsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dselsam/subscriptions","organizations_url":"https://api.github.com/users/dselsam/orgs","repos_url":"https://api.github.com/users/dselsam/repos","events_url":"https://api.github.com/users/dselsam/events{/privacy}","received_events_url":"https://api.github.com/users/dselsam/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"dselsam","id":4520285,"avatar_url":"https://avatars.githubusercontent.com/u/4520285?v=3","gravatar_id":"","url":"https://api.github.com/users/dselsam","html_url":"https://github.com/dselsam","followers_url":"https://api.github.com/users/dselsam/followers","following_url":"https://api.github.com/users/dselsam/following{/other_user}","gists_url":"https://api.github.com/users/dselsam/gists{/gist_id}","starred_url":"https://api.github.com/users/dselsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dselsam/subscriptions","organizations_url":"https://api.github.com/users/dselsam/orgs","repos_url":"https://api.github.com/users/dselsam/repos","events_url":"https://api.github.com/users/dselsam/events{/privacy}","received_events_url":"https://api.github.com/users/dselsam/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-08-13T18:06:45Z","updated_at":"2015-08-15T01:53:09Z","closed_at":"2015-08-15T01:53:09Z","body":"The following:\r\n```Lean\r\nconstants (A B : Type)\r\nconstants (f : A → B) \r\nattribute f [coercion]\r\n```\r\nyields:\r\n```\r\n error: invalid coercion, type of 'f' does not match any of the allowed expected types for coercions\r\n  Pi (x_1 : A_1) ... (x_n : A_n) (y: C x_1 ... x_n), D t_1 ... t_m\r\n  Pi (x_1 : A_1) ... (x_n : A_n) (y: C x_1 ... x_n), Type\r\n  Pi (x_1 : A_1) ... (x_n : A_n) (y: C x_1 ... x_n), A -> B\r\n```\r\nThe problem is `f`'s extra level corresponding to `B`. The coercion is pruned at\r\n\r\nhttps://github.com/leanprover/lean/blob/master/src/library/coercion.cpp#L327\r\n\r\nand it works if we fix the universe of `B`.\r\n\r\nThe issue is that the error message does not display enough information to diagnose the problem."}}