aboutsummaryrefslogtreecommitdiffhomepage
path: root/test-suite/success/univnames.v
diff options
context:
space:
mode:
authorGravatar Matthieu Sozeau <mattam@mattam.org>2015-10-07 13:11:52 +0200
committerGravatar Matthieu Sozeau <mattam@mattam.org>2015-10-07 13:17:11 +0200
commitd37aab528dca587127b9f9944e1521e4fc3d9cc7 (patch)
tree3d8db828b3e6644c924a75592dded2a168fbeb59 /test-suite/success/univnames.v
parent840155eafd9607c7656c80770de1e2819fe56a13 (diff)
Univs: add Strict Universe Declaration option (on by default)
This option disallows "declare at first use" semantics for universe variables (in @{}), forcing the declaration of _all_ universes appearing in a definition when introducing it with syntax Definition/Inductive foo@{i j k} .. The bound universes at the end of a definition/inductive must be exactly those ones, no extras allowed currently. Test-suite files using the old semantics just disable the option.
Diffstat (limited to 'test-suite/success/univnames.v')
-rw-r--r--test-suite/success/univnames.v26
1 files changed, 26 insertions, 0 deletions
diff --git a/test-suite/success/univnames.v b/test-suite/success/univnames.v
new file mode 100644
index 000000000..31d264f64
--- /dev/null
+++ b/test-suite/success/univnames.v
@@ -0,0 +1,26 @@
+Set Universe Polymorphism.
+
+Definition foo@{i j} (A : Type@{i}) (B : Type@{j}) := A.
+
+Set Printing Universes.
+
+Fail Definition bar@{i} (A : Type@{i}) (B : Type) := A.
+
+Definition baz@{i j} (A : Type@{i}) (B : Type@{j}) := (A * B)%type.
+
+Fail Definition bad@{i j} (A : Type@{i}) (B : Type@{j}) : Type := (A * B)%type.
+
+Fail Definition bad@{i} (A : Type@{i}) (B : Type@{j}) : Type := (A * B)%type.
+
+Definition shuffle@{i j} (A : Type@{j}) (B : Type@{i}) := (A * B)%type.
+
+Definition nothing (A : Type) := A.
+
+Inductive bla@{l k} : Type@{k} := blaI : Type@{l} -> bla.
+
+Inductive blacopy@{k l} : Type@{k} := blacopyI : Type@{l} -> blacopy.
+
+
+Universe g.
+
+Inductive blacopy'@{l} : Type@{g} := blacopy'I : Type@{l} -> blacopy'. \ No newline at end of file