@@ -408,8 +408,7 @@ type response = {
408
408
}
409
409
410
410
let process_obj (loc : Location.t ) (st : external_desc ) (prim_name : string )
411
- (arg_types_ty : Ast_core_type.param_type list )
412
- (result_type : Ast_core_type.t ) :
411
+ (arg_types_ty : Parsetree.arg list ) (result_type : Ast_core_type.t ) :
413
412
int * Parsetree. core_type * External_ffi_types. t =
414
413
match st with
415
414
| {
@@ -440,11 +439,10 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
440
439
Ext_list. fold_right arg_types_ty ([] , [] , [] )
441
440
(fun
442
441
param_type
443
- (arg_labels , (arg_types : Ast_core_type.param_type list ), result_types )
442
+ (arg_labels , (arg_types : Parsetree.arg list ), result_types )
444
443
->
445
- let arg_label = param_type.label in
446
- let loc = param_type.loc in
447
- let ty = param_type.ty in
444
+ let arg_label = param_type.lbl in
445
+ let ty = param_type.typ in
448
446
let new_arg_label, new_arg_types, output_tys =
449
447
match arg_label with
450
448
| Nolabel -> (
@@ -459,7 +457,7 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
459
457
| Labelled {txt = label } -> (
460
458
let field_name =
461
459
match
462
- Ast_attributes. iter_process_bs_string_as param_type.attr
460
+ Ast_attributes. iter_process_bs_string_as param_type.attrs
463
461
with
464
462
| Some alias -> alias
465
463
| None -> label
@@ -518,7 +516,7 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
518
516
| Optional {txt = label } -> (
519
517
let field_name =
520
518
match
521
- Ast_attributes. iter_process_bs_string_as param_type.attr
519
+ Ast_attributes. iter_process_bs_string_as param_type.attrs
522
520
with
523
521
| Some alias -> alias
524
522
| None -> label
@@ -594,7 +592,7 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
594
592
in
595
593
596
594
( List. length new_arg_types_ty,
597
- Ast_core_type. mk_fn_type new_arg_types_ty result,
595
+ Ast_core_type. mk_fn_type ~loc new_arg_types_ty result,
598
596
External_ffi_types. ffi_obj_create arg_kinds )
599
597
| _ -> Location. raise_errorf ~loc " Attribute found that conflicts with %@obj"
600
598
@@ -942,11 +940,10 @@ let handle_attributes (loc : Bs_loc.t) (type_annotation : Parsetree.core_type)
942
940
let splice = external_desc.splice in
943
941
let arg_type_specs, new_arg_types_ty, arg_type_specs_length =
944
942
Ext_list. fold_right arg_types_ty
945
- (([] , [] , 0 )
946
- : External_arg_spec. params * Ast_core_type. param_type list * int )
943
+ (([] , [] , 0 ) : External_arg_spec. params * Parsetree. arg list * int )
947
944
(fun param_type (arg_type_specs , arg_types , i ) ->
948
- let arg_label = param_type.label in
949
- let ty = param_type.ty in
945
+ let arg_label = param_type.lbl in
946
+ let ty = param_type.typ in
950
947
(if i = 0 && splice then
951
948
match arg_label with
952
949
| Optional _ ->
@@ -1008,7 +1005,7 @@ let handle_attributes (loc : Bs_loc.t) (type_annotation : Parsetree.core_type)
1008
1005
let return_wrapper =
1009
1006
check_return_wrapper loc external_desc.return_wrapper result_type
1010
1007
in
1011
- let fn_type = Ast_core_type. mk_fn_type new_arg_types_ty result_type in
1008
+ let fn_type = Ast_core_type. mk_fn_type ~loc new_arg_types_ty result_type in
1012
1009
( build_uncurried_type ~arity: (List. length new_arg_types_ty) fn_type,
1013
1010
External_ffi_types. ffi_bs arg_type_specs return_wrapper ffi,
1014
1011
unused_attrs,
0 commit comments