File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -409,12 +409,13 @@ let process_obj
409409 let new_arg_label, new_arg_types, output_tys =
410410 match arg_label with
411411 | Nolabel ->
412- let new_ty, arg_type = refine_obj_arg_type ~nolabel: true ty in
413- if arg_type = Extern_unit then
414- External_arg_spec. empty_kind arg_type,
415- {param_type with ty = new_ty}::arg_types, result_types
416- else
417- Location. raise_errorf ~loc " expect label, optional, or unit here"
412+ begin match ty.ptyp_desc with
413+ | Ptyp_constr ({txt = Lident "unit" ;_} , [] ) ->
414+ External_arg_spec. empty_kind Extern_unit ,
415+ param_type ::arg_types, result_types
416+ | _ ->
417+ Location. raise_errorf ~loc " expect label, optional, or unit here"
418+ end
418419 | Labelled name ->
419420 let new_ty, obj_arg_type = refine_obj_arg_type ~nolabel: false ty in
420421 begin match obj_arg_type with
You can’t perform that action at this time.
0 commit comments