diff options
Diffstat (limited to 'pretyping')
| -rw-r--r-- | pretyping/typeclasses_errors.ml | 12 | ||||
| -rw-r--r-- | pretyping/typeclasses_errors.mli | 7 |
2 files changed, 12 insertions, 7 deletions
diff --git a/pretyping/typeclasses_errors.ml b/pretyping/typeclasses_errors.ml index 89eb217d28..a6a9a75c5a 100644 --- a/pretyping/typeclasses_errors.ml +++ b/pretyping/typeclasses_errors.ml @@ -22,7 +22,8 @@ type typeclass_error = | NotAClass of constr | UnboundMethod of global_reference * Id.t Loc.located (* Class name, method *) | NoInstance of Id.t Loc.located * constr list - | UnsatisfiableConstraints of evar_map * (existential_key * Evar_kinds.t) option + | UnsatisfiableConstraints of + evar_map * (existential_key * Evar_kinds.t) option * Evar.Set.t option | MismatchedContextInstance of contexts * constr_expr list * rel_context (* found, expected *) exception TypeClassError of env * typeclass_error @@ -35,14 +36,15 @@ let unbound_method env cid id = typeclass_error env (UnboundMethod (cid, id)) let no_instance env id args = typeclass_error env (NoInstance (id, args)) -let unsatisfiable_constraints env evd ev = +let unsatisfiable_constraints env evd ev comp = match ev with | None -> - raise (TypeClassError (env, UnsatisfiableConstraints (evd, None))) + let err = UnsatisfiableConstraints (evd, None, comp) in + raise (TypeClassError (env, err)) | Some ev -> let loc, kind = Evd.evar_source ev evd in - let err = TypeClassError (env, UnsatisfiableConstraints (evd, Some (ev, kind))) in - Loc.raise loc err + let err = UnsatisfiableConstraints (evd, Some (ev, kind), comp) in + Loc.raise loc (TypeClassError (env, err)) let mismatched_ctx_inst env c n m = typeclass_error env (MismatchedContextInstance (c, n, m)) diff --git a/pretyping/typeclasses_errors.mli b/pretyping/typeclasses_errors.mli index a55b9204ef..94bbfce00e 100644 --- a/pretyping/typeclasses_errors.mli +++ b/pretyping/typeclasses_errors.mli @@ -25,7 +25,9 @@ type typeclass_error = | NotAClass of constr | UnboundMethod of global_reference * Id.t located (** Class name, method *) | NoInstance of Id.t located * constr list - | UnsatisfiableConstraints of evar_map * (existential_key * Evar_kinds.t) option + | UnsatisfiableConstraints of + evar_map * (existential_key * Evar_kinds.t) option * Evar.Set.t option + (** evar map, unresolvable evar, connex component *) | MismatchedContextInstance of contexts * constr_expr list * rel_context (** found, expected *) exception TypeClassError of env * typeclass_error @@ -36,7 +38,8 @@ val unbound_method : env -> global_reference -> Id.t located -> 'a val no_instance : env -> Id.t located -> constr list -> 'a -val unsatisfiable_constraints : env -> evar_map -> evar option -> 'a +val unsatisfiable_constraints : env -> evar_map -> evar option -> + Evar.Set.t option -> 'a val mismatched_ctx_inst : env -> contexts -> constr_expr list -> rel_context -> 'a |
