aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-03-10 10:22:45 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-03-10 10:22:45 +0000
commitb00cb9ccbb02e2aa913294887749fff79b0adad5 (patch)
treebe346e575c0c82cacc77b7fb8f5bc620f4ad8886 /toplevel
parent82887aeb4bde7ddd8e1000881124198de5845f9d (diff)
Une passe sur l'unification des evars (suite aux commits 10124, 10125, 10145)
- Correction bug des filtres dans define_evar_as_abstraction - Nettoyage, documentation et réorganisations diverses git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10650 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/himsg.ml19
1 files changed, 13 insertions, 6 deletions
diff --git a/toplevel/himsg.ml b/toplevel/himsg.ml
index 16f3971f5..4d1b608e6 100644
--- a/toplevel/himsg.ml
+++ b/toplevel/himsg.ml
@@ -345,6 +345,11 @@ let explain_not_clean env ev t k =
str "with a term using variable " ++ var ++ spc () ++
str "which is not in its scope."
+let explain_unsolvability = function
+ | None -> mt()
+ | Some (SeveralInstancesFound n) ->
+ strbrk " (several distinct possible instances found)"
+
let pr_ne_context_of header footer env =
if Environ.rel_context env = empty_rel_context &
Environ.named_context env = empty_named_context then footer
@@ -356,14 +361,16 @@ let explain_typeclass_resolution env evi k =
(match Typeclasses.class_of_constr evi.evar_concl with
| Some c ->
let env = Evd.evar_env evi in
- str"." ++ fnl () ++ str "Could not find an instance for " ++
+ fnl () ++ str "Could not find an instance for " ++
pr_lconstr_env env evi.evar_concl ++
pr_ne_context_of (str " in environment:"++ fnl ()) (str ".") env
- | None -> str ".")
- | _ -> str "."
+ | None -> mt())
+ | _ -> mt()
-let explain_unsolvable_implicit env evi k =
- str "Cannot infer " ++ explain_hole_kind env k ++ explain_typeclass_resolution env evi k
+let explain_unsolvable_implicit env evi k explain =
+ str "Cannot infer " ++ explain_hole_kind env k ++
+ explain_unsolvability explain ++ str "." ++
+ explain_typeclass_resolution env evi k
let explain_var_not_found env id =
str "The variable" ++ spc () ++ pr_id id ++
@@ -451,7 +458,7 @@ let explain_pretype_error env err =
| CantFindCaseType c -> explain_cant_find_case_type env c
| OccurCheck (n,c) -> explain_occur_check env n c
| NotClean (n,c,k) -> explain_not_clean env n c k
- | UnsolvableImplicit (evi,k) -> explain_unsolvable_implicit env evi k
+ | UnsolvableImplicit (evi,k,exp) -> explain_unsolvable_implicit env evi k exp
| VarNotFound id -> explain_var_not_found env id
| UnexpectedType (actual,expect) -> explain_unexpected_type env actual expect
| NotProduct c -> explain_not_product env c