diff options
| author | Hugo Herbelin | 2017-10-04 23:55:54 +0200 |
|---|---|---|
| committer | Hugo Herbelin | 2017-10-05 00:31:40 +0200 |
| commit | 26f216653aed171a70513d3f5ece059ab30bcd73 (patch) | |
| tree | 94f94e0af01f74136cec2637ad29f3c1401436e2 /test-suite/bugs | |
| parent | b9740771e8113cb9e607793887be7a12587d0326 (diff) | |
Fixing #5762 (supporting imp. args. in "where" clause of an inductive def.).
This allows e.g. the following to work:
Reserved Notation "* a" (at level 70).
Inductive P {n : nat} : nat -> Prop := c m : *m where "* m" := (P m).
We seize this opportunity to make main calls to Metasyntax to depend
on an arbitrary env rather than on Global.env.
Incidentally, this fixes a little coqdoc bug in classifying the
inductive type referred to in the "where" clause.
Diffstat (limited to 'test-suite/bugs')
| -rw-r--r-- | test-suite/bugs/closed/5762.v | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test-suite/bugs/closed/5762.v b/test-suite/bugs/closed/5762.v new file mode 100644 index 0000000000..edd5c8d73d --- /dev/null +++ b/test-suite/bugs/closed/5762.v @@ -0,0 +1,28 @@ +(* Supporting imp. params. in inductive or fixpoints mutually defined with a notation *) + +Reserved Notation "* a" (at level 70). +Inductive P {n : nat} : nat -> Prop := +| c m : *m +where "* m" := (P m). + +Reserved Notation "##". +Inductive I {A:Type} := C : ## where "##" := I. + +(* The following was working in 8.6 *) + +Require Import Vector. + +Reserved Notation "# a" (at level 70). +Fixpoint f {n : nat} (v:Vector.t nat n) : nat := + match v with + | nil _ => 0 + | cons _ _ _ v => S (#v) + end +where "# v" := (f v). + +(* The following was working in 8.6 *) + +Reserved Notation "%% a" (at level 70). +Record R := + {g : forall {A} (a:A), a=a where "%% x" := (g x); + k : %% 0 = eq_refl}. |
