@@ -882,22 +882,22 @@ let handle_attributes (loc : Bs_loc.t) (type_annotation : Parsetree.core_type)
882882 let arg_label = param_type.label in
883883 let ty = param_type.ty in
884884 (if i = 0 && splice then
885- match arg_label with
886- | Optional _ ->
887- Location. raise_errorf ~loc
888- " %@variadic expect the last type to be a non optional"
889- | Labelled _ | Nolabel -> (
890- if ty.ptyp_desc = Ptyp_any then
885+ match arg_label with
886+ | Optional _ ->
891887 Location. raise_errorf ~loc
892- " %@variadic expect the last type to be an array" ;
893- if spec_of_ptyp true ty <> Nothing then
894- Location. raise_errorf ~loc
895- " %@variadic expect the last type to be an array" ;
896- match ty.ptyp_desc with
897- | Ptyp_constr ({txt = Lident "array" ; _} , [_ ]) -> ()
898- | _ ->
899- Location. raise_errorf ~loc
900- " %@variadic expect the last type to be an array" ));
888+ " %@variadic expect the last type to be a non optional"
889+ | Labelled _ | Nolabel -> (
890+ if ty.ptyp_desc = Ptyp_any then
891+ Location. raise_errorf ~loc
892+ " %@variadic expect the last type to be an array" ;
893+ if spec_of_ptyp true ty <> Nothing then
894+ Location. raise_errorf ~loc
895+ " %@variadic expect the last type to be an array" ;
896+ match ty.ptyp_desc with
897+ | Ptyp_constr ({txt = Lident "array" ; _} , [_ ]) -> ()
898+ | _ ->
899+ Location. raise_errorf ~loc
900+ " %@variadic expect the last type to be an array" ));
901901 let ( (arg_label : External_arg_spec.label_noname ),
902902 arg_type,
903903 new_arg_types ) =
@@ -974,8 +974,7 @@ let pval_prim_of_option_labels (labels : (bool * string Asttypes.loc) list)
974974 (ends_with_unit : bool ) =
975975 let arg_kinds =
976976 Ext_list. fold_right labels
977- (if ends_with_unit then [External_arg_spec. empty_kind Extern_unit ]
978- else [] )
977+ (if ends_with_unit then [External_arg_spec. empty_kind Extern_unit ] else [] )
979978 (fun (is_option , p ) arg_kinds ->
980979 let label_name = p.txt in
981980 let obj_arg_label =
0 commit comments