aboutsummaryrefslogtreecommitdiff
path: root/pretyping/typeclasses.ml
diff options
context:
space:
mode:
Diffstat (limited to 'pretyping/typeclasses.ml')
-rw-r--r--pretyping/typeclasses.ml6
1 files changed, 4 insertions, 2 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 []