@@ -408,8 +408,7 @@ type response = {
408408}
409409
410410let 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 ) :
413412 int * Parsetree. core_type * External_ffi_types. t =
414413 match st with
415414 | {
@@ -440,11 +439,10 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
440439 Ext_list. fold_right arg_types_ty ([] , [] , [] )
441440 (fun
442441 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 )
444443 ->
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
448446 let new_arg_label, new_arg_types, output_tys =
449447 match arg_label with
450448 | Nolabel -> (
@@ -459,7 +457,7 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
459457 | Labelled {txt = label } -> (
460458 let field_name =
461459 match
462- Ast_attributes. iter_process_bs_string_as param_type.attr
460+ Ast_attributes. iter_process_bs_string_as param_type.attrs
463461 with
464462 | Some alias -> alias
465463 | None -> label
@@ -518,7 +516,7 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
518516 | Optional {txt = label } -> (
519517 let field_name =
520518 match
521- Ast_attributes. iter_process_bs_string_as param_type.attr
519+ Ast_attributes. iter_process_bs_string_as param_type.attrs
522520 with
523521 | Some alias -> alias
524522 | None -> label
@@ -594,7 +592,7 @@ let process_obj (loc : Location.t) (st : external_desc) (prim_name : string)
594592 in
595593
596594 ( 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,
598596 External_ffi_types. ffi_obj_create arg_kinds )
599597 | _ -> Location. raise_errorf ~loc " Attribute found that conflicts with %@obj"
600598
@@ -942,11 +940,10 @@ let handle_attributes (loc : Bs_loc.t) (type_annotation : Parsetree.core_type)
942940 let splice = external_desc.splice in
943941 let arg_type_specs, new_arg_types_ty, arg_type_specs_length =
944942 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 )
947944 (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
950947 (if i = 0 && splice then
951948 match arg_label with
952949 | Optional _ ->
@@ -1008,7 +1005,7 @@ let handle_attributes (loc : Bs_loc.t) (type_annotation : Parsetree.core_type)
10081005 let return_wrapper =
10091006 check_return_wrapper loc external_desc.return_wrapper result_type
10101007 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
10121009 ( build_uncurried_type ~arity: (List. length new_arg_types_ty) fn_type,
10131010 External_ffi_types. ffi_bs arg_type_specs return_wrapper ffi,
10141011 unused_attrs,
0 commit comments