forked from coq/coq
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forbid inflationary universes to be template polymorphic.
Template inductive types with a signature Type@{u} -> Type@{u+1} allowed to make the algebraic increment to increase arbitrarily. Despite being a very weak invariant, most parts of the code expect at most a +1 increment in algebraic universes. We prevent a source of generation of such ill-formed algebraic types by forbidding template polymorphic arities to return a +n on a template universe. Fixes coq#19230: Anomaly with explicit universe +1 and template polymorphism.
- Loading branch information
Showing
3 changed files
with
23 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(* This inductive cannot be template *) | ||
Inductive foo@{u} (A:Type@{u}) : Type@{u+1} := . | ||
Fail Check foo (foo (foo nat)). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters