{"action":"created","issue":{"url":"https://api.github.com/repos/coq/coq/issues/7424","repository_url":"https://api.github.com/repos/coq/coq","labels_url":"https://api.github.com/repos/coq/coq/issues/7424/labels{/name}","comments_url":"https://api.github.com/repos/coq/coq/issues/7424/comments","events_url":"https://api.github.com/repos/coq/coq/issues/7424/events","html_url":"https://github.com/coq/coq/issues/7424","id":320134574,"number":7424,"title":"Inductive type sort annotations are ignored","user":{"login":"andres-erbsen","id":918403,"avatar_url":"https://avatars0.githubusercontent.com/u/918403?v=4","gravatar_id":"","url":"https://api.github.com/users/andres-erbsen","html_url":"https://github.com/andres-erbsen","followers_url":"https://api.github.com/users/andres-erbsen/followers","following_url":"https://api.github.com/users/andres-erbsen/following{/other_user}","gists_url":"https://api.github.com/users/andres-erbsen/gists{/gist_id}","starred_url":"https://api.github.com/users/andres-erbsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andres-erbsen/subscriptions","organizations_url":"https://api.github.com/users/andres-erbsen/orgs","repos_url":"https://api.github.com/users/andres-erbsen/repos","events_url":"https://api.github.com/users/andres-erbsen/events{/privacy}","received_events_url":"https://api.github.com/users/andres-erbsen/received_events","type":"User","site_admin":false},"labels":[{"id":755681591,"url":"https://api.github.com/repos/coq/coq/labels/part:%20universes","name":"part: universes","color":"dddddd","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-04T02:04:58Z","updated_at":"2018-05-04T07:32:39Z","closed_at":null,"author_association":"NONE","body":"<!-- Thank you for your contribution.\r\n     Please complete the following information when reporting a bug. -->\r\n\r\n#### Version\r\n\r\n~~~~~\r\nThe Coq Proof Assistant, version 8.8.0 (May 2018)\r\ncompiled on May 3 2018 7:11:49 with OCaml 4.06.0\r\n~~~~~\r\n\r\n#### Operating system\r\n\r\nArch Linux, up to date as of today.\r\n\r\n#### Description of the problem\r\n\r\nInductive types seem to be assigned an automatically inferred sort regardless of the annotation after the colon in the `Inductive` vernacular. This happens with and without `Universe Polymorphism` and with and without `Universe Minimization ToSet`.\r\n\r\nI would expect all examples below to pass, but most of them fail.\r\n\r\n~~~~~\r\nInductive a : Type := .\r\nGoal False.\r\n  lazymatch type of a with Type => idtac end.\r\n  (* Error: No matching clauses for match. *)\r\nAbort.\r\nCheck fun (T : Type) => cons a (cons T nil).\r\n(* The term \"(T :: nil)%list\" has type \"list Type\" *)\r\n(* while it is expected to have type \"list Prop\" (universe inconsistency). *)\r\n\r\nInductive b : Type := b0 | bS (_:b).\r\nGoal False.\r\n  lazymatch type of b with Type => idtac end.\r\n  (* Error: No matching clauses for match. *)\r\nAbort.\r\nCheck fun (T : Type) => cons b (cons T nil).\r\n(* The term \"(T :: nil)%list\" has type \"list Type\" *)\r\n(* while it is expected to have type \"list Set\" (universe inconsistency). *)\r\n\r\nModule WithUniversePolymorhism.\r\n  (* succeeds as expected *)\r\n  Local Set Universe Polymorphism.\r\n  Inductive a : Type := .\r\n  Goal False.\r\n    lazymatch type of a with Type => idtac end.\r\n  Abort.\r\n  Check fun (T : Type) => cons a (cons T nil).\r\n\r\n  Inductive b : Type := b0 | bS (_:b).\r\n  Goal False.\r\n    lazymatch type of b with Type => idtac end.\r\n    (* Error: No matching clauses for match. *)\r\n  Abort.\r\n  Check fun (T : Type) => cons b (cons T nil).\r\n  (* The term \"(T :: nil)%list\" has type \"list Type\" *)\r\n  (* while it is expected to have type \"list Set\" (universe inconsistency). *)\r\nModule WithUniversePolymorhism.\r\n\r\nModule WithUniversePolymorhismAndNoToSet.\r\n  Local Set Universe Polymorphism.\r\n  Local Unset Universe Minimization ToSet.\r\n  (* succeeds as expected *)\r\n  Inductive a : Type := .\r\n  Goal False.\r\n    lazymatch type of a with Type => idtac end.\r\n  Abort.\r\n  Check fun (T : Type) => cons a (cons T nil).\r\n\r\n  Inductive b : Type := b0 | bS (_:b).\r\n  Goal False.\r\n    lazymatch type of b with Type => idtac end.\r\n    (* Error: No matching clauses for match. *)\r\n  Abort.\r\n  Check fun (T : Type) => cons b (cons T nil).\r\n  (* The term \"(T :: nil)%list\" has type \"list Type\" *)\r\n  (* while it is expected to have type \"list Set\" (universe inconsistency). *)\r\nModule WithUniversePolymorhismAndNoToSet.\r\n~~~~~"},"comment":{"url":"https://api.github.com/repos/coq/coq/issues/comments/386525464","html_url":"https://github.com/coq/coq/issues/7424#issuecomment-386525464","issue_url":"https://api.github.com/repos/coq/coq/issues/7424","id":386525464,"user":{"login":"Zimmi48","id":1108325,"avatar_url":"https://avatars2.githubusercontent.com/u/1108325?v=4","gravatar_id":"","url":"https://api.github.com/users/Zimmi48","html_url":"https://github.com/Zimmi48","followers_url":"https://api.github.com/users/Zimmi48/followers","following_url":"https://api.github.com/users/Zimmi48/following{/other_user}","gists_url":"https://api.github.com/users/Zimmi48/gists{/gist_id}","starred_url":"https://api.github.com/users/Zimmi48/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zimmi48/subscriptions","organizations_url":"https://api.github.com/users/Zimmi48/orgs","repos_url":"https://api.github.com/users/Zimmi48/repos","events_url":"https://api.github.com/users/Zimmi48/events{/privacy}","received_events_url":"https://api.github.com/users/Zimmi48/received_events","type":"User","site_admin":false},"created_at":"2018-05-04T07:32:39Z","updated_at":"2018-05-04T07:32:39Z","author_association":"CONTRIBUTOR","body":"Not at all an expert in this area but it is a well-known issue IIUC.\r\n@JasonGross once proposed the following workaround:\r\n\r\n```coq\r\nInductive a : let t := Type in t :=.\r\nCheck fun (T : Type) => cons a (cons T nil).\r\n```"}}
{"actor":{"display_login":"Zimmi48"}}