From 40c830beaad34a9ad435816da11fb93322368478 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Fri, 13 Mar 2020 17:52:02 +0100 Subject: Fixes #11692 (clear dependent knows about let-in). --- test-suite/output/clear.out | 5 +++++ test-suite/output/clear.v | 8 ++++++++ theories/Init/Tactics.v | 1 + 3 files changed, 14 insertions(+) create mode 100644 test-suite/output/clear.out create mode 100644 test-suite/output/clear.v diff --git a/test-suite/output/clear.out b/test-suite/output/clear.out new file mode 100644 index 0000000000..42e3abf26f --- /dev/null +++ b/test-suite/output/clear.out @@ -0,0 +1,5 @@ +1 subgoal + + z := 0 : nat + ============================ + True diff --git a/test-suite/output/clear.v b/test-suite/output/clear.v new file mode 100644 index 0000000000..d584cf752e --- /dev/null +++ b/test-suite/output/clear.v @@ -0,0 +1,8 @@ +Module Wish11692. + +(* Support for let-in in clear dependent *) + +Goal forall x : Prop, let z := 0 in let z' : (fun _ => True) x := I in let y := x in y -> True. +Proof. intros x z z' y H. clear dependent x. Show. exact I. Qed. + +End Wish11692. diff --git a/theories/Init/Tactics.v b/theories/Init/Tactics.v index 6de9f8f88d..db36d0cda7 100644 --- a/theories/Init/Tactics.v +++ b/theories/Init/Tactics.v @@ -233,6 +233,7 @@ Tactic Notation "clear" "dependent" hyp(h) := clear h || match goal with | H : context [ h ] |- _ => depclear H; depclear h + | H := context [ h ] |- _ => depclear H; depclear h end || fail "hypothesis to clear is used in the conclusion (maybe indirectly)" in depclear h. -- cgit v1.2.3