diff options
| -rw-r--r-- | pretyping/unification.ml | 9 | ||||
| -rw-r--r-- | tactics/class_tactics.ml4 | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/pretyping/unification.ml b/pretyping/unification.ml index dbf7d6469e..a1066df7a5 100644 --- a/pretyping/unification.ml +++ b/pretyping/unification.ml @@ -490,9 +490,12 @@ let w_merge env with_types flags (metas,evars) evd = let evd' = mimick_evar evd flags f (Array.length cl) evn in w_merge_rec evd' metas evars eqns | _ -> - w_merge_rec (solve_simple_evar_eqn env evd ev rhs') - metas evars' eqns - end + let evi = Evd.find (evars_of evd) evn in + let rty = Retyping.get_type_of_with_meta env (evars_of evd) (metas_of evd) rhs' in + let evd', rhs'' = w_coerce_to_type env evd rhs' rty evi.evar_concl in + let evd'' = solve_simple_evar_eqn env evd' ev rhs'' in + w_merge_rec evd'' metas evars' eqns + end | [] -> (* Process metas *) diff --git a/tactics/class_tactics.ml4 b/tactics/class_tactics.ml4 index e1395ed8b7..976974e78f 100644 --- a/tactics/class_tactics.ml4 +++ b/tactics/class_tactics.ml4 @@ -1718,7 +1718,7 @@ let setoid_proof gl ty ?(bindings=NoBindings) meth fallback = (CRef (Qualid (dummy_loc, Nametab.shortest_qualid_of_global Idset.empty (Lazy.force meth)))) ~bindings gl with Not_found | Typeclasses_errors.TypeClassError (_, _) | - Ploc.Exc (_, Typeclasses_errors.TypeClassError (_, _)) -> + Stdpp.Exc_located (_, Typeclasses_errors.TypeClassError (_, _)) -> match fallback gl with | Some tac -> tac gl | None -> |
