aboutsummaryrefslogtreecommitdiff
path: root/theories/Init
diff options
context:
space:
mode:
authorTej Chajed2020-10-15 09:17:15 -0500
committerTej Chajed2020-10-15 09:23:47 -0500
commitcc06679015013fa26736e10227967cd38be3d6b5 (patch)
treee972537c241ce48bd1a28e4679f2516ef8b7dcc4 /theories/Init
parent476520ab32d3e975f6cee8aabcd04ad5fdfbbd77 (diff)
Report a useful error for dependent destruction
Similar to `dependent induction`, report an error message for `dependent destruction` saying that importing `Coq.Program.Equality` is required, rather than failing at parsing time. This is a small extension of #605 to cover dependent destruction as well. Here I also put in some tests.
Diffstat (limited to 'theories/Init')
-rw-r--r--theories/Init/Tactics.v9
1 files changed, 6 insertions, 3 deletions
diff --git a/theories/Init/Tactics.v b/theories/Init/Tactics.v
index e1db68aea9..35bab1021e 100644
--- a/theories/Init/Tactics.v
+++ b/theories/Init/Tactics.v
@@ -245,13 +245,16 @@ Tactic Notation "clear" "dependent" hyp(h) :=
Tactic Notation "revert" "dependent" hyp(h) :=
generalize dependent h.
-(** Provide an error message for dependent induction that reports an import is
-required to use it. Importing Coq.Program.Equality will shadow this notation
-with the actual [dependent induction] tactic. *)
+(** Provide an error message for dependent induction/dependent destruction that
+ reports an import is required to use it. Importing Coq.Program.Equality will
+ shadow this notation with the actual tactics. *)
Tactic Notation "dependent" "induction" ident(H) :=
fail "To use dependent induction, first [Require Import Coq.Program.Equality.]".
+Tactic Notation "dependent" "destruction" ident(H) :=
+ fail "To use dependent destruction, first [Require Import Coq.Program.Equality.]".
+
(** *** [inversion_sigma] *)
(** The built-in [inversion] will frequently leave equalities of
dependent pairs. When the first type in the pair is an hProp or