summaryrefslogtreecommitdiff
path: root/test-suite/misc/poly-capture-global-univs
diff options
context:
space:
mode:
Diffstat (limited to 'test-suite/misc/poly-capture-global-univs')
-rw-r--r--test-suite/misc/poly-capture-global-univs/_CoqProject9
-rw-r--r--test-suite/misc/poly-capture-global-univs/src/evil.ml49
-rw-r--r--test-suite/misc/poly-capture-global-univs/src/evilImpl.ml22
-rw-r--r--test-suite/misc/poly-capture-global-univs/src/evilImpl.mli2
-rw-r--r--test-suite/misc/poly-capture-global-univs/src/evil_plugin.mlpack2
-rw-r--r--test-suite/misc/poly-capture-global-univs/theories/evil.v13
6 files changed, 57 insertions, 0 deletions
diff --git a/test-suite/misc/poly-capture-global-univs/_CoqProject b/test-suite/misc/poly-capture-global-univs/_CoqProject
new file mode 100644
index 00000000..70ec2460
--- /dev/null
+++ b/test-suite/misc/poly-capture-global-univs/_CoqProject
@@ -0,0 +1,9 @@
+-Q theories Evil
+-I src
+
+src/evil.ml4
+src/evilImpl.ml
+src/evilImpl.mli
+src/evil_plugin.mlpack
+theories/evil.v
+
diff --git a/test-suite/misc/poly-capture-global-univs/src/evil.ml4 b/test-suite/misc/poly-capture-global-univs/src/evil.ml4
new file mode 100644
index 00000000..565e979a
--- /dev/null
+++ b/test-suite/misc/poly-capture-global-univs/src/evil.ml4
@@ -0,0 +1,9 @@
+
+open Stdarg
+open EvilImpl
+
+DECLARE PLUGIN "evil_plugin"
+
+VERNAC COMMAND FUNCTIONAL EXTEND VernacEvil CLASSIFIED AS SIDEFF
+| [ "Evil" ident(x) ident(y) ] -> [ fun ~atts ~st -> evil x y; st ]
+END
diff --git a/test-suite/misc/poly-capture-global-univs/src/evilImpl.ml b/test-suite/misc/poly-capture-global-univs/src/evilImpl.ml
new file mode 100644
index 00000000..6d8ce7c5
--- /dev/null
+++ b/test-suite/misc/poly-capture-global-univs/src/evilImpl.ml
@@ -0,0 +1,22 @@
+open Names
+
+let evil t f =
+ let open Univ in
+ let open Entries in
+ let open Decl_kinds in
+ let open Constr in
+ let k = IsDefinition Definition in
+ let u = Level.var 0 in
+ let tu = mkType (Universe.make u) in
+ let te = Declare.definition_entry
+ ~univs:(Monomorphic_const_entry (ContextSet.singleton u)) tu
+ in
+ let tc = Declare.declare_constant t (DefinitionEntry te, k) in
+ let tc = mkConst tc in
+
+ let fe = Declare.definition_entry
+ ~univs:(Polymorphic_const_entry (UContext.make (Instance.of_array [|u|],Constraint.empty)))
+ ~types:(Term.mkArrow tc tu)
+ (mkLambda (Name.Name (Id.of_string "x"), tc, mkRel 1))
+ in
+ ignore (Declare.declare_constant f (DefinitionEntry fe, k))
diff --git a/test-suite/misc/poly-capture-global-univs/src/evilImpl.mli b/test-suite/misc/poly-capture-global-univs/src/evilImpl.mli
new file mode 100644
index 00000000..97c7e3da
--- /dev/null
+++ b/test-suite/misc/poly-capture-global-univs/src/evilImpl.mli
@@ -0,0 +1,2 @@
+
+val evil : Names.Id.t -> Names.Id.t -> unit
diff --git a/test-suite/misc/poly-capture-global-univs/src/evil_plugin.mlpack b/test-suite/misc/poly-capture-global-univs/src/evil_plugin.mlpack
new file mode 100644
index 00000000..0093328a
--- /dev/null
+++ b/test-suite/misc/poly-capture-global-univs/src/evil_plugin.mlpack
@@ -0,0 +1,2 @@
+EvilImpl
+Evil
diff --git a/test-suite/misc/poly-capture-global-univs/theories/evil.v b/test-suite/misc/poly-capture-global-univs/theories/evil.v
new file mode 100644
index 00000000..7fd98c27
--- /dev/null
+++ b/test-suite/misc/poly-capture-global-univs/theories/evil.v
@@ -0,0 +1,13 @@
+
+Declare ML Module "evil_plugin".
+
+Evil T f. (* <- if this doesn't fail then the rest goes through *)
+
+Definition g : Type -> Set := f.
+
+Require Import Hurkens.
+
+Lemma absurd : False.
+Proof.
+ exact (TypeNeqSmallType.paradox (g Type) eq_refl).
+Qed.