diff options
Diffstat (limited to 'pretyping')
| -rw-r--r-- | pretyping/typeclasses.ml | 6 | ||||
| -rw-r--r-- | pretyping/typeclasses.mli | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/pretyping/typeclasses.ml b/pretyping/typeclasses.ml index 5447c21458..caee039e0e 100644 --- a/pretyping/typeclasses.ml +++ b/pretyping/typeclasses.ml @@ -337,9 +337,11 @@ let instance_constructor cl args = let lenpars = List.length (List.filter (fun (na, b, t) -> b = None) (snd cl.cl_context)) in let pars = fst (list_chop lenpars args) in match cl.cl_impl with - | IndRef ind -> applistc (mkConstruct (ind, 1)) args, + | IndRef ind -> Some (applistc (mkConstruct (ind, 1)) args), applistc (mkInd ind) pars - | ConstRef cst -> list_last args, applistc (mkConst cst) pars + | ConstRef cst -> + let term = if args = [] then None else Some (list_last args) in + term, applistc (mkConst cst) pars | _ -> assert false let typeclasses () = Gmap.fold (fun _ l c -> l :: c) !classes [] diff --git a/pretyping/typeclasses.mli b/pretyping/typeclasses.mli index 69a472cb51..e4db68fbcd 100644 --- a/pretyping/typeclasses.mli +++ b/pretyping/typeclasses.mli @@ -73,7 +73,7 @@ val is_implicit_arg : hole_kind -> bool (** Returns the term and type for the given instance of the parameters and fields of the type class. *) -val instance_constructor : typeclass -> constr list -> constr * types +val instance_constructor : typeclass -> constr list -> constr option * types (** Resolvability. Only undefined evars could be marked or checked for resolvability. *) |
