From cce1b6f06f9802f4d7c977322cec654ad2582d63 Mon Sep 17 00:00:00 2001 From: Matthieu Sozeau Date: Thu, 12 Feb 2015 16:43:28 +0100 Subject: Fix bug #3960: potential evar instance categorized as an unresolvable goal in Instance. Also remove some dead code. --- pretyping/typeclasses.ml | 9 --------- pretyping/typeclasses.mli | 2 -- toplevel/classes.ml | 4 ++-- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/pretyping/typeclasses.ml b/pretyping/typeclasses.ml index b64ccf60dd..18e83056bd 100644 --- a/pretyping/typeclasses.ml +++ b/pretyping/typeclasses.ml @@ -483,15 +483,6 @@ let is_instance = function is_class (IndRef ind) | _ -> false -let is_implicit_arg = function -| Evar_kinds.GoalEvar -> false -| _ -> true - (* match k with *) - (* ImplicitArg (ref, (n, id), b) -> true *) - (* | InternalHole -> true *) - (* | _ -> false *) - - (* To embed a boolean for resolvability status. This is essentially a hack to mark which evars correspond to goals and do not need to be resolved when we have nested [resolve_all_evars] diff --git a/pretyping/typeclasses.mli b/pretyping/typeclasses.mli index 1a0b6696a8..b3170b9702 100644 --- a/pretyping/typeclasses.mli +++ b/pretyping/typeclasses.mli @@ -77,8 +77,6 @@ val instance_priority : instance -> int option val is_class : global_reference -> bool val is_instance : global_reference -> bool -val is_implicit_arg : Evar_kinds.t -> bool - (** Returns the term and type for the given instance of the parameters and fields of the type class. *) diff --git a/toplevel/classes.ml b/toplevel/classes.ml index f44ac36788..01b560d0c4 100644 --- a/toplevel/classes.ml +++ b/toplevel/classes.ml @@ -165,7 +165,7 @@ let new_instance ?(abstract=false) ?(global=false) poly ctx (instid, bk, cl) pro in let env' = push_rel_context ctx env in evars := Evarutil.nf_evar_map !evars; - evars := resolve_typeclasses ~filter:Typeclasses.no_goals ~fail:true env !evars; + evars := resolve_typeclasses ~filter:Typeclasses.all_evars ~fail:true env !evars; let subst = List.map (Evarutil.nf_evar !evars) subst in if abstract then begin @@ -232,7 +232,7 @@ let new_instance ?(abstract=false) ?(global=false) poly ctx (instid, bk, cl) pro k.cl_projs; c :: props, rest' with Not_found -> - (CHole (Loc.ghost, Some Evar_kinds.GoalEvar, Misctypes.IntroAnonymous, None) :: props), rest + (CHole (Loc.ghost, None(* Some Evar_kinds.GoalEvar *), Misctypes.IntroAnonymous, None) :: props), rest else props, rest) ([], props) k.cl_props in -- cgit v1.2.3