aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorherbelin2010-09-11 19:19:04 +0000
committerherbelin2010-09-11 19:19:04 +0000
commitbc1ddb1081dd44887cb2f8b33937138cb1e1658c (patch)
tree396f99140c055245ae45cda6afd68462634c0191 /pretyping
parentb0dd26994fcc609668466d969dd88d9a008030e2 (diff)
Improving a few error messages in Ltac interpretation
- improving error message when a reference to unfold is not found - repairing anomaly when an evaluable reference exists at internalisation-time but not at run time, and similarly for an arbitrary term (but the latter is new from 8.3 because of the new use of retyping instead of understand for typing Ltac values) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13408 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/pretyping.ml7
1 files changed, 6 insertions, 1 deletions
diff --git a/pretyping/pretyping.ml b/pretyping/pretyping.ml
index 8898e5989a..7017edaf28 100644
--- a/pretyping/pretyping.ml
+++ b/pretyping/pretyping.ml
@@ -249,6 +249,11 @@ module Pretyping_F (Coercion : Coercion.S) = struct
str " depends on pattern variable name " ++ pr_id id ++
str " which is not bound in current context.")
+ let protected_get_type_of env sigma c =
+ try Retyping.get_type_of env sigma c
+ with Anomaly _ ->
+ errorlabstrm "" (str "Cannot reinterpret " ++ quote (print_constr c) ++ str " in the current environment.")
+
let pretype_id loc env sigma (lvar,unbndltacvars) id =
(* Look for the binder of [id] *)
try
@@ -260,7 +265,7 @@ module Pretyping_F (Coercion : Coercion.S) = struct
let (ids,c) = List.assoc id lvar in
let subst = List.map (invert_ltac_bound_name env id) ids in
let c = substl subst c in
- { uj_val = c; uj_type = Retyping.get_type_of env sigma c }
+ { uj_val = c; uj_type = protected_get_type_of env sigma c }
with Not_found ->
(* Check if [id] is a section or goal variable *)
try