diff options
| author | Gaëtan Gilbert | 2019-10-31 14:41:58 +0100 |
|---|---|---|
| committer | Gaëtan Gilbert | 2019-10-31 14:41:58 +0100 |
| commit | 49f0201e5570480116a107765a867e99ef9a8bc6 (patch) | |
| tree | 9f905a0a11faba5aba1cb463a1e543f4849d95d5 /test-suite | |
| parent | ce837d592b14095770b5c4a2a8c8040b20893718 (diff) | |
| parent | 6da3091bdb249af11302042e7958f87b2cd36e63 (diff) | |
Merge PR #10861: Fix #10615: Notation substitution for Ltac2 terms.
Reviewed-by: SkySkimmer
Ack-by: jfehrle
Diffstat (limited to 'test-suite')
| -rw-r--r-- | test-suite/ltac2/term_notations.v | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test-suite/ltac2/term_notations.v b/test-suite/ltac2/term_notations.v new file mode 100644 index 0000000000..85eb858d4e --- /dev/null +++ b/test-suite/ltac2/term_notations.v @@ -0,0 +1,33 @@ +Require Import Ltac2.Ltac2. + +(* Preterms are not terms *) +Fail Notation "[ x ]" := $x. + +Section Foo. + +Notation "[ x ]" := ltac2:(Control.refine (fun _ => Constr.pretype x)). + +Goal [ True ]. +Proof. +constructor. +Qed. + +End Foo. + +Section Bar. + +(* Have fun with context capture *) +Notation "[ x ]" := ltac2:( + let c () := Constr.pretype x in + refine constr:(forall n : nat, n = ltac2:(Notations.exact0 true c)) +). + +Goal forall n : nat, [ n ]. +Proof. +reflexivity. +Qed. + +(* This fails currently, which is arguably a bug *) +Fail Goal [ n ]. + +End Bar. |
