@@ -433,9 +433,7 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
433
433
if String. length prim_name <> 0 then
434
434
Location. raise_errorf ~loc
435
435
" %@obj expect external names to be empty string" ;
436
- let ( arg_kinds,
437
- new_arg_types_ty,
438
- (result_types : Parsetree.object_field list ) ) =
436
+ let arg_kinds, args, (result_types : Parsetree.object_field list ) =
439
437
Ext_list. fold_right arg_types_ty ([] , [] , [] )
440
438
(fun
441
439
param_type
@@ -591,8 +589,8 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
591
589
(* result type can not be labeled *)
592
590
in
593
591
594
- ( List. length new_arg_types_ty ,
595
- Ast_helper.Typ. arrows ~loc new_arg_types_ty result,
592
+ ( List. length args ,
593
+ Ast_helper.Typ. arrows ~loc args result,
596
594
External_ffi_types. ffi_obj_create arg_kinds )
597
595
| _ -> Location. raise_errorf ~loc " Attribute found that conflicts with %@obj"
598
596
@@ -938,7 +936,7 @@ let handle_attributes (loc : Bs_loc.t) (type_annotation : Parsetree.core_type)
938
936
(build_uncurried_type ~arity new_type, spec, unused_attrs, false )
939
937
else
940
938
let splice = external_desc.splice in
941
- let arg_type_specs, new_arg_types_ty , arg_type_specs_length =
939
+ let arg_type_specs, args , arg_type_specs_length =
942
940
Ext_list. fold_right arg_types_ty
943
941
(([] , [] , 0 ) : External_arg_spec. params * Parsetree. arg list * int )
944
942
(fun param_type (arg_type_specs , arg_types , i ) ->
@@ -1005,8 +1003,8 @@ let handle_attributes (loc : Bs_loc.t) (type_annotation : Parsetree.core_type)
1005
1003
let return_wrapper =
1006
1004
check_return_wrapper loc external_desc.return_wrapper result_type
1007
1005
in
1008
- let fn_type = Ast_helper.Typ. arrows ~loc new_arg_types_ty result_type in
1009
- ( build_uncurried_type ~arity: (List. length new_arg_types_ty ) fn_type,
1006
+ let fn_type = Ast_helper.Typ. arrows ~loc args result_type in
1007
+ ( build_uncurried_type ~arity: (List. length args ) fn_type,
1010
1008
External_ffi_types. ffi_bs arg_type_specs return_wrapper ffi,
1011
1009
unused_attrs,
1012
1010
relative )
0 commit comments