diff options
Diffstat (limited to 'pretyping')
| -rw-r--r-- | pretyping/pretyping.ml | 4 | ||||
| -rw-r--r-- | pretyping/typeclasses_errors.ml | 3 | ||||
| -rw-r--r-- | pretyping/typeclasses_errors.mli | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/pretyping/pretyping.ml b/pretyping/pretyping.ml index 980a5075f0..f9fcdb7b63 100644 --- a/pretyping/pretyping.ml +++ b/pretyping/pretyping.ml @@ -700,7 +700,9 @@ module Pretyping_F (Coercion : Coercion.S) = struct let evdref = ref (Evd.create_evar_defs sigma) in let c = pretype_gen evdref env lvar kind c in let evd,_ = consider_remaining_unif_problems env !evdref in - if fail_evar then check_evars env Evd.empty evd c; + if fail_evar then + (let evd = Typeclasses.resolve_typeclasses ~onlyargs:false ~all:false env (evars_of evd) evd in + check_evars env Evd.empty evd c); evd, c (** Entry points of the high-level type synthesis algorithm *) diff --git a/pretyping/typeclasses_errors.ml b/pretyping/typeclasses_errors.ml index 1648f667ab..4db8261085 100644 --- a/pretyping/typeclasses_errors.ml +++ b/pretyping/typeclasses_errors.ml @@ -28,6 +28,7 @@ type typeclass_error = | NotAClass of constr | UnboundMethod of global_reference * identifier located (* Class name, method *) | NoInstance of identifier located * constr list + | UnsatisfiableConstraints of evar_map | MismatchedContextInstance of contexts * constr_expr list * named_context (* found, expected *) exception TypeClassError of env * typeclass_error @@ -40,4 +41,6 @@ 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 evm = typeclass_error env (UnsatisfiableConstraints evm) + 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 82e37f41d8..a697087d25 100644 --- a/pretyping/typeclasses_errors.mli +++ b/pretyping/typeclasses_errors.mli @@ -28,6 +28,7 @@ type typeclass_error = | NotAClass of constr | UnboundMethod of global_reference * identifier located (* Class name, method *) | NoInstance of identifier located * constr list + | UnsatisfiableConstraints of evar_map | MismatchedContextInstance of contexts * constr_expr list * named_context (* found, expected *) exception TypeClassError of env * typeclass_error @@ -38,4 +39,6 @@ val unbound_method : env -> global_reference -> identifier located -> 'a val no_instance : env -> identifier located -> constr list -> 'a +val unsatisfiable_constraints : env -> evar_map -> 'a + val mismatched_ctx_inst : env -> contexts -> constr_expr list -> named_context -> 'a |
