aboutsummaryrefslogtreecommitdiff
path: root/test-suite/bugs
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2019-09-25 14:30:59 +0200
committerPierre-Marie Pédrot2019-09-25 14:30:59 +0200
commit4e022849b7119e3a51b46fa73132b3e3cc7927ab (patch)
tree67430007168765a36c4df6ff348eff1dfbb0ae92 /test-suite/bugs
parent092fa59dd892ea99ee17cae03da9dffe5ab3007f (diff)
parenteed41b6b570755aa4b40e2ce308c57db88ec9a18 (diff)
Merge PR #10781: Fixes #10778 (fresh was not updated after renaming of intropattern entry in #10239)
Reviewed-by: ppedrot
Diffstat (limited to 'test-suite/bugs')
-rw-r--r--test-suite/bugs/closed/bug_10778.v32
1 files changed, 32 insertions, 0 deletions
diff --git a/test-suite/bugs/closed/bug_10778.v b/test-suite/bugs/closed/bug_10778.v
new file mode 100644
index 0000000000..25d729b7e6
--- /dev/null
+++ b/test-suite/bugs/closed/bug_10778.v
@@ -0,0 +1,32 @@
+(* Test that fresh avoid the variables of intro patterns but also of
+ simple intro patterns *)
+
+Ltac exploit_main t T pat cleanup
+ :=
+ (lazymatch T with
+ | ?U1 -> ?U2 =>
+ let H := fresh
+ in
+idtac "H=" H;
+ assert U1 as H;
+ [cleanup () | exploit_main (t H) U2 pat ltac:(fun _ => clear H; cleanup ())]
+ | _ =>
+ pose proof t as pat;
+ cleanup ()
+ end).
+
+Tactic Notation "exploit" constr(t) "as" simple_intropattern(pat)
+ :=
+ exploit_main t ltac:(type of t) pat ltac:(fun _ => idtac).
+
+Goal (True -> True) -> True.
+intro H0. exploit H0 as H.
+Abort.
+
+Tactic Notation "exploit'" constr(t) "as" intropattern(pat)
+ :=
+ exploit_main t ltac:(type of t) pat ltac:(fun _ => idtac).
+
+Goal (True -> True) -> True.
+intro H0. exploit' H0 as H.
+Abort.