aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2016-05-13 17:41:23 +0200
committerPierre-Marie Pédrot2016-05-13 17:56:07 +0200
commitb679eae9d3588f6cb91be174ab80a64fb5c434a4 (patch)
tree745a5c0fdcba8f27de12b5ab2f875eb33baf1b49
parent4d9bcbda2fbf09939cddff4e4b42e5397d8a5cf1 (diff)
More informative error message when interpreting ltac variables in terms.
-rw-r--r--pretyping/pretyping.ml7
1 files changed, 5 insertions, 2 deletions
diff --git a/pretyping/pretyping.ml b/pretyping/pretyping.ml
index 21eb100b4e..5d1f77a5a2 100644
--- a/pretyping/pretyping.ml
+++ b/pretyping/pretyping.ml
@@ -389,9 +389,12 @@ let pretype_id pretype k0 loc env evdref lvar id =
with Not_found ->
(* Check if [id] is a ltac variable not bound to a term *)
(* and build a nice error message *)
- if Id.Map.mem id lvar.ltac_genargs then
+ if Id.Map.mem id lvar.ltac_genargs then begin
+ let Geninterp.Val.Dyn (typ, _) = Id.Map.find id lvar.ltac_genargs in
user_err_loc (loc,"",
- str "Variable " ++ pr_id id ++ str " should be bound to a term.");
+ str "Variable " ++ pr_id id ++ str " should be bound to a term but is \
+ bound to a " ++ Geninterp.Val.pr typ ++ str ".")
+ end;
(* Check if [id] is a section or goal variable *)
try
{ uj_val = mkVar id; uj_type = (get_type (lookup_named id env)) }