aboutsummaryrefslogtreecommitdiffhomepage
path: root/pretyping/unification.ml
diff options
context:
space:
mode:
Diffstat (limited to 'pretyping/unification.ml')
-rw-r--r--pretyping/unification.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/pretyping/unification.ml b/pretyping/unification.ml
index 71b054cd6..236dc9876 100644
--- a/pretyping/unification.ml
+++ b/pretyping/unification.ml
@@ -124,6 +124,11 @@ let rec subst_meta_instances bl c =
(** [env] should be the context in which the metas live *)
+let evar_source_of_meta mv evd =
+ match Evd.meta_name evd mv with
+ | Anonymous -> assert false (* only dependent metas posed as evars (?) *)
+ | Name id -> (Loc.ghost,Evar_kinds.VarInstance id)
+
let pose_all_metas_as_evars env evd t =
let evdref = ref evd in
let rec aux t = match kind_of_term t with
@@ -133,7 +138,8 @@ let pose_all_metas_as_evars env evd t =
| None ->
let {rebus=ty;freemetas=mvs} = Evd.meta_ftype evd mv in
let ty = if Evd.Metaset.is_empty mvs then ty else aux ty in
- let ev = Evarutil.e_new_evar evdref env ~src:(Loc.ghost,Evar_kinds.GoalEvar) ty in
+ let src = evar_source_of_meta mv !evdref in
+ let ev = Evarutil.e_new_evar evdref env ~src ty in
evdref := meta_assign mv (ev,(Conv,TypeNotProcessed)) !evdref;
ev)
| _ ->