@@ -95015,7 +95015,6 @@ let assemble_args_has_splice call_loc ffi (arg_types : specs) (args : exprs)
95015
95015
let accs, eff = aux labels args in
95016
95016
begin match args, (arg : E.t) with
95017
95017
| [], {expression_desc = Array (ls,_mutable_flag) ;_ } ->
95018
- assert (arg_kind.arg_type = Extern_arg_array);
95019
95018
Ext_list.append ls accs, eff
95020
95019
| _ ->
95021
95020
if args = [] then dynamic := true ;
@@ -105880,8 +105879,8 @@ let spec_of_ptyp
105880
105879
begin match ptyp_desc with
105881
105880
| Ptyp_constr ({txt = Lident "unit"; _}, [])
105882
105881
-> if nolabel then Extern_unit else Nothing
105883
- | Ptyp_constr ({txt = Lident "array"; _}, [_])
105884
- -> Extern_arg_array
105882
+ (* | Ptyp_constr ({txt = Lident "array"; _}, [_])
105883
+ -> Extern_arg_array *)
105885
105884
| Ptyp_variant _ ->
105886
105885
Bs_warnings.prerr_bs_ffi_warning ptyp.ptyp_loc Unsafe_poly_variant_type;
105887
105886
Nothing
@@ -106670,6 +106669,21 @@ let handle_attributes
106670
106669
(fun param_type (arg_type_specs, arg_types, i) ->
106671
106670
let arg_label = Ast_compatible.convert param_type.label in
106672
106671
let ty = param_type.ty in
106672
+ if i = 0 && splice then
106673
+ begin match arg_label with
106674
+ | Optional _ ->
106675
+ Location.raise_errorf ~loc "[@@@@bs.splice] expect the last type to be a non optional"
106676
+ | Labelled _ | Nolabel
106677
+ ->
106678
+ if Ast_core_type.is_any ty then
106679
+ Location.raise_errorf ~loc "[@@@@bs.splice] expect the last type to be an array";
106680
+ if spec_of_ptyp true ty <> Nothing then
106681
+ Location.raise_errorf ~loc "[@@@@bs.splice] expect the last type to be an array";
106682
+ match ty.ptyp_desc with
106683
+ | Ptyp_constr({txt = Lident "array"; _}, [_])
106684
+ -> ()
106685
+ | _ -> Location.raise_errorf ~loc "[@@@@bs.splice] expect the last type to be an array";
106686
+ end ;
106673
106687
let arg_label, arg_type, new_arg_types =
106674
106688
match arg_label with
106675
106689
| Optional s ->
@@ -106699,8 +106713,8 @@ let handle_attributes
106699
106713
External_arg_spec.empty_label, arg_type, {param_type with ty = new_ty} :: arg_types
106700
106714
end
106701
106715
in
106702
- (if i = 0 && splice && arg_type <> Extern_arg_array then
106703
- Location.raise_errorf ~loc "[@@@@bs.splice] expect the last type to be an array");
106716
+ (* ( if i = 0 && splice && arg_type <> Extern_arg_array then
106717
+ Location.raise_errorf ~loc "[@@@@bs.splice] expect the last type to be an array"); *)
106704
106718
({ arg_label ;
106705
106719
arg_type
106706
106720
} :: arg_type_specs,
0 commit comments