aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Herbelin2017-01-31 06:36:25 +0100
committerHugo Herbelin2017-01-31 09:41:13 +0100
commitf5923c2174fbb419397f127af31ab1cd0b223e0a (patch)
tree3babfe486803cf4c0b27ed70f9b7f600ebb01f49
parenta0fb4f60bb328935da053250e7964150fdf57a86 (diff)
Fixing #5311 (anomaly on unexpected intro pattern).
This was introduced in 8.5 while reorganizing the structure of intro-patterns.
-rw-r--r--tactics/tacinterp.ml2
-rw-r--r--test-suite/bugs/closed/5331.v11
2 files changed, 12 insertions, 1 deletions
diff --git a/tactics/tacinterp.ml b/tactics/tacinterp.ml
index 23d188aa73..2cfd2d6b12 100644
--- a/tactics/tacinterp.ml
+++ b/tactics/tacinterp.ml
@@ -894,7 +894,7 @@ let interp_or_and_intro_pattern_option ist env sigma = function
(match coerce_to_intro_pattern env (Id.Map.find id ist.lfun) with
| IntroAction (IntroOrAndPattern l) -> sigma, Some (loc,l)
| _ ->
- raise (CannotCoerceTo "a disjunctive/conjunctive introduction pattern"))
+ user_err_loc (loc,"", str "Cannot coerce to a disjunctive/conjunctive pattern."))
| Some (ArgArg (loc,l)) ->
let sigma,l = interp_or_and_intro_pattern ist env sigma l in
sigma, Some (loc,l)
diff --git a/test-suite/bugs/closed/5331.v b/test-suite/bugs/closed/5331.v
new file mode 100644
index 0000000000..0d72fcb5df
--- /dev/null
+++ b/test-suite/bugs/closed/5331.v
@@ -0,0 +1,11 @@
+(* Checking no anomaly on some unexpected intropattern *)
+
+Ltac ih H := induction H as H.
+Ltac ih' H H' := induction H as H'.
+
+Goal True -> True.
+Fail intro H; ih H.
+intro H; ih' H ipattern:[].
+exact I.
+Qed.
+