diff options
| author | msozeau | 2008-09-04 08:59:41 +0000 |
|---|---|---|
| committer | msozeau | 2008-09-04 08:59:41 +0000 |
| commit | 7273a302676a0ecb4f51d39dbe5cc8848b886473 (patch) | |
| tree | f39751d06cd50ac2fd167e4a06e0b5c558cf5df4 /pretyping | |
| parent | 73e85bb97b86c53f34b984d0193835c1d722c59f (diff) | |
Fix camlp5-ism "Ploc.Exc" and add a unification fix: when solving an
evar, do unification between the evar type and the type of the instance
to properly propagate information.
Typical example: in context ?A : Type, ?R : relation ?A. When we instantiate ?R
using a goal like x = y by @eq t, we need to instantiate A to t as well.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@11357 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'pretyping')
| -rw-r--r-- | pretyping/unification.ml | 9 |
1 files changed, 6 insertions, 3 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 *) |
