aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2010-09-17 18:03:40 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2010-09-17 18:03:40 +0000
commitc1e3eafa4990b4e1e41d589c0e1a20b641ea1493 (patch)
tree982783f0b8ce2a19e1cdaff0ce79467c29a7b4f5
parent84aaa74ff9537dfdfc214ab60f8acf42466878b1 (diff)
Fixed a problem introduced in r12607 after pattern_of_constr served
both for interpreting ltac patterns and patterns of "change pat with term". In particular, in the current status, Goal evars needs mandatorily to have the hole_kind GoalEvar. If this is too complicated to enforce, we might eventually consider another approach to the question of interpreting patterns in general. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13428 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--tactics/evar_tactics.ml3
-rw-r--r--test-suite/success/ltac.v17
2 files changed, 19 insertions, 1 deletions
diff --git a/tactics/evar_tactics.ml b/tactics/evar_tactics.ml
index f1faf00ac..97177ba34 100644
--- a/tactics/evar_tactics.ml
+++ b/tactics/evar_tactics.ml
@@ -51,7 +51,8 @@ let instantiate n (ist,rawc) ido gl =
gl
let let_evar name typ gls =
- let sigma',evar = Evarutil.new_evar gls.sigma (pf_env gls) typ in
+ let src = (dummy_loc,GoalEvar) in
+ let sigma',evar = Evarutil.new_evar gls.sigma (pf_env gls) ~src typ in
Refiner.tclTHEN (Refiner.tclEVARS sigma')
(Tactics.letin_tac None name evar None nowhere) gls
diff --git a/test-suite/success/ltac.v b/test-suite/success/ltac.v
index 32c6d1431..a8d1ba7f5 100644
--- a/test-suite/success/ltac.v
+++ b/test-suite/success/ltac.v
@@ -281,3 +281,20 @@ Goal forall x:nat, True.
intro x.
Fail clear x; f x.
Abort.
+
+(* Do not consider evars as unification holes in Ltac matching (and at
+ least not as holes unrelated to the original evars)
+ [Example adapted from Ynot code]
+ *)
+
+Ltac not_eq e1 e2 :=
+ match e1 with
+ | e2 => fail 1
+ | _ => idtac
+ end.
+
+Goal True.
+evar(foo:nat).
+let evval := eval compute in foo in not_eq evval 1.
+let evval := eval compute in foo in not_eq 1 evval.
+Abort.