@@ -119,7 +119,7 @@ let refine_arg_type ~(nolabel:bool) (ptyp : Ast_core_type.t)
119
119
else (* ([`a|`b] [@bs.string]) *)
120
120
ptyp, spec_of_ptyp nolabel ptyp
121
121
122
-
122
+ let refine_obj_arg_type = refine_arg_type
123
123
(* * Given the type of argument, process its [bs.] attribute and new type,
124
124
The new type is currently used to reconstruct the external type
125
125
and result type in [@@bs.obj]
@@ -409,14 +409,14 @@ let process_obj
409
409
let new_arg_label, new_arg_types, output_tys =
410
410
match arg_label with
411
411
| Nolabel ->
412
- let new_ty, arg_type = refine_arg_type ~nolabel: true ty in
412
+ let new_ty, arg_type = refine_obj_arg_type ~nolabel: true ty in
413
413
if arg_type = Extern_unit then
414
414
External_arg_spec. empty_kind arg_type,
415
415
{param_type with ty = new_ty}::arg_types, result_types
416
416
else
417
417
Location. raise_errorf ~loc " expect label, optional, or unit here"
418
418
| Labelled name ->
419
- let new_ty, obj_arg_type = refine_arg_type ~nolabel: false ty in
419
+ let new_ty, obj_arg_type = refine_obj_arg_type ~nolabel: false ty in
420
420
begin match obj_arg_type with
421
421
| Ignore ->
422
422
External_arg_spec. empty_kind obj_arg_type,
@@ -499,7 +499,8 @@ let process_obj
499
499
if result_type.ptyp_desc = Ptyp_any then
500
500
Ast_core_type. make_obj ~loc result_types
501
501
else
502
- fst (refine_arg_type ~nolabel: true result_type)
502
+ result_type
503
+ (* TODO: do we need do some error checking here *)
503
504
(* result type can not be labeled *)
504
505
in
505
506
Ast_compatible. mk_fn_type new_arg_types_ty result,
0 commit comments