aboutsummaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorMatthieu Sozeau2014-05-26 13:58:56 +0200
committerMatthieu Sozeau2014-05-26 14:16:26 +0200
commit15999903f875f4b5dbb3d5240d2ca39acc3cd777 (patch)
tree9906d3cf7d95d4d3f0e996811aa429532b825f0d /test-suite
parentd8176e6baaa33692ed82b9ac3c6e57e85f51dff0 (diff)
- Fix in kernel conversion not folding the universe constraints
correctly when comparing stacks. - Disallow Type i <= Prop/Set constraints, that would otherwise allow constraints that make a universe lower than Prop. - Fix stm/lemmas that was pushing constraints to the global context, it is done depending on the constant/variable polymorphic status now. - Adapt generalized rewriting in Type code to these fixes.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/success/polymorphism.v22
1 files changed, 21 insertions, 1 deletions
diff --git a/test-suite/success/polymorphism.v b/test-suite/success/polymorphism.v
index 1ef2713e44..99284eb547 100644
--- a/test-suite/success/polymorphism.v
+++ b/test-suite/success/polymorphism.v
@@ -211,7 +211,27 @@ Polymorphic Definition id {A : Type} (a : A) : A := a.
Definition typeid := (@id Type).
+Fail Check (Prop : Set).
+Fail Check (Set : Set).
+Check (Set : Type).
+Check (Prop : Type).
+Definition setType := $(let t := type of Set in exact t)$.
+Definition foo (A : Prop) := A.
+
+Fail Check foo Set.
+Check fun A => foo A.
+Fail Check fun A : Type => foo A.
+Check fun A : Prop => foo A.
+Fail Definition bar := fun A : Set => foo A.
+
+Fail Check (let A := Type in foo (id A)).
+
+Definition fooS (A : Set) := A.
+
+Check (let A := nat in fooS (id A)).
+Fail Check (let A := Set in fooS (id A)).
+Fail Check (let A := Prop in fooS (id A)).
(* Some tests of sort-polymorphisme *)
Section S.
@@ -227,7 +247,7 @@ End S.
(*
Check f nat nat : Set.
*)
-Definition foo:= I nat nat : Set.
+Definition foo' := I nat nat.
Print Universes. Print foo. Set Printing Universes. Print foo.
(* Polymorphic axioms: *)