aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel/himsg.ml
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-10-04 22:08:08 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-10-04 22:08:08 +0000
commitaa130b53c16a58c29f017510d876a31b674a2504 (patch)
treeab141e0e10aa63aa2dddf899b04c34572580e1f6 /toplevel/himsg.ml
parentdcda0fbe3784d9cfa45ee5273e2354f3c7b2c9b8 (diff)
Improving error message when abtraction over goal (abstract_list_all
used when applying schemes - induction, rewrite, ...) is well-typed but not of the right type. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15853 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'toplevel/himsg.ml')
-rw-r--r--toplevel/himsg.ml8
1 files changed, 8 insertions, 0 deletions
diff --git a/toplevel/himsg.ml b/toplevel/himsg.ml
index 53c4325e1..141acb3db 100644
--- a/toplevel/himsg.ml
+++ b/toplevel/himsg.ml
@@ -453,6 +453,13 @@ let explain_cannot_find_well_typed_abstraction env p l =
str "leads to a term" ++ spc () ++ pr_lconstr_env env p ++ spc () ++
str "which is ill-typed."
+let explain_wrong_abstraction_type env na abs expected result =
+ let ppname = match na with Anonymous -> mt() | Name id -> pr_id id ++ spc() in
+ str "Cannot instantiate metavariable " ++ ppname ++ strbrk "of type " ++
+ pr_lconstr_env env expected ++ strbrk " with abstraction " ++
+ pr_lconstr_env env abs ++ strbrk " of incompatible type " ++
+ pr_lconstr_env env result ++ str "."
+
let explain_abstraction_over_meta _ m n =
strbrk "Too complex unification problem: cannot find a solution for both " ++
pr_name m ++ spc () ++ str "and " ++ pr_name n ++ str "."
@@ -517,6 +524,7 @@ let explain_pretype_error env sigma err =
| CannotUnifyBindingType (m,n) -> explain_cannot_unify_binding_type env m n
| CannotFindWellTypedAbstraction (p,l) ->
explain_cannot_find_well_typed_abstraction env p l
+ | WrongAbstractionType (n,a,t,u) -> explain_wrong_abstraction_type env n a t u
| AbstractionOverMeta (m,n) -> explain_abstraction_over_meta env m n
| NonLinearUnification (m,c) -> explain_non_linear_unification env m c
| TypingError t -> explain_type_error env sigma t