diff options
| author | Hugo Herbelin | 2014-06-13 10:33:40 +0200 |
|---|---|---|
| committer | Hugo Herbelin | 2014-06-13 12:08:34 +0200 |
| commit | 176f40f976741c8fb6e020c0eaeac4df59a474bc (patch) | |
| tree | 75111a6ff55f049bc01181f7dd60e6c7f7e951ab /pretyping | |
| parent | c06fa8b4c16c35fe48039d5b13e181cca9ebbb51 (diff) | |
Improved error message when a meta posed as an evar remains unsolved
in case prefix 'e' of "apply" and co is not given.
Diffstat (limited to 'pretyping')
| -rw-r--r-- | pretyping/evd.ml | 1 | ||||
| -rw-r--r-- | pretyping/unification.ml | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/pretyping/evd.ml b/pretyping/evd.ml index 2041f35bf0..e36e16c05b 100644 --- a/pretyping/evd.ml +++ b/pretyping/evd.ml @@ -1560,6 +1560,7 @@ let pr_evar_source = function | Evar_kinds.GoalEvar -> str "goal evar" | Evar_kinds.ImpossibleCase -> str "type of impossible pattern-matching clause" | Evar_kinds.MatchingVar _ -> str "matching variable" + | Evar_kinds.VarInstance id -> str "instance of " ++ pr_id id let pr_evar_info evi = let phyps = diff --git a/pretyping/unification.ml b/pretyping/unification.ml index 71b054cd6e..236dc98765 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) | _ -> |
