aboutsummaryrefslogtreecommitdiff
path: root/src/Util/Tactics/ConstrFail.v
diff options
context:
space:
mode:
Diffstat (limited to 'src/Util/Tactics/ConstrFail.v')
-rw-r--r--src/Util/Tactics/ConstrFail.v9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Util/Tactics/ConstrFail.v b/src/Util/Tactics/ConstrFail.v
new file mode 100644
index 000000000..fe8a05630
--- /dev/null
+++ b/src/Util/Tactics/ConstrFail.v
@@ -0,0 +1,9 @@
+(** A tactic that executes immediately (during expression evaluation / constr-construction) and fails. Ideally we can eventually give it a nicer error message. COQBUG(3913) *)
+
+Ltac constr_fail :=
+ let __ := match goal with _ => fail 1 "Constr construction failed. Please look at the message log (*coq*, or run your tactic again inside Fail or try) to see more details" end in
+ ().
+
+Ltac constr_fail_with msg_tac :=
+ let __ := match goal with _ => msg_tac () end in
+ constr_fail.