aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Herbelin2014-11-07 20:08:55 +0100
committerHugo Herbelin2014-11-07 20:10:17 +0100
commit5c599bfa507a5586e1f481983a5a7d4a6e19dadf (patch)
tree5c385e5db3221d396f1facded9084f626c15a28f
parentb3eb49d5e32ea8456d4f840b22639e5f5a9a354c (diff)
Fixing #3562 ("as" in "destruct" expects either a disjunctive
intropattern or a bound ltac variable).
-rw-r--r--tactics/tacintern.ml8
-rw-r--r--test-suite/bugs/closed/3562.v6
2 files changed, 11 insertions, 3 deletions
diff --git a/tactics/tacintern.ml b/tactics/tacintern.ml
index 22951491b7..9ca8da9d35 100644
--- a/tactics/tacintern.ml
+++ b/tactics/tacintern.ml
@@ -268,9 +268,11 @@ and intern_intro_pattern_action lf ist = function
and intern_or_and_intro_pattern lf ist =
List.map (List.map (intern_intro_pattern lf ist))
-let intern_or_and_intro_pattern_loc lf ist l =
- intern_or_var (fun (loc,l) -> (loc,intern_or_and_intro_pattern lf ist l))
- ist l
+let intern_or_and_intro_pattern_loc lf ist = function
+ | ArgVar (_,id) as x ->
+ if find_var id ist then x
+ else error "Disjunctive/conjunctive introduction pattern expected."
+ | ArgArg (loc,l) -> ArgArg (loc,intern_or_and_intro_pattern lf ist l)
let intern_intro_pattern_naming_loc lf ist (loc,pat) =
(loc,intern_intro_pattern_naming lf ist pat)
diff --git a/test-suite/bugs/closed/3562.v b/test-suite/bugs/closed/3562.v
new file mode 100644
index 0000000000..1a1410a3b1
--- /dev/null
+++ b/test-suite/bugs/closed/3562.v
@@ -0,0 +1,6 @@
+(* Should not be an anomaly as it was at some time in
+ September/October 2014 but some "Disjunctive/conjunctive
+ introduction pattern expected" error *)
+
+Theorem t: True.
+Fail destruct 0 as x.