@@ -492,17 +492,22 @@ let process_obj
492
492
param_type::arg_types, result_types
493
493
| Nothing ->
494
494
let s = (Lam_methname. translate name) in
495
- {obj_arg_label = External_arg_spec. optional s; obj_arg_type},
495
+ let for_sure_not_nested =
496
+ match ty.ptyp_desc with
497
+ | Ptyp_constr ({txt = Lident txt ;_} , [] ) ->
498
+ Ast_core_type. is_builtin_rank0_type txt
499
+ | _ -> false in
500
+ {obj_arg_label = External_arg_spec. optional for_sure_not_nested s; obj_arg_type},
496
501
param_type :: arg_types,
497
502
( Parsetree. Otag ({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc ty) :: result_types)
498
503
| Int _ ->
499
504
let s = Lam_methname. translate name in
500
- {obj_arg_label = External_arg_spec. optional s ; obj_arg_type },
505
+ {obj_arg_label = External_arg_spec. optional true s ; obj_arg_type },
501
506
param_type :: arg_types,
502
507
(Otag ({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc @@ Ast_literal. type_int ~loc () ) :: result_types)
503
508
| Poly_var_string _ ->
504
509
let s = Lam_methname. translate name in
505
- {obj_arg_label = External_arg_spec. optional s ; obj_arg_type },
510
+ {obj_arg_label = External_arg_spec. optional true s ; obj_arg_type },
506
511
param_type::arg_types,
507
512
(Otag ({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc @@ Ast_literal. type_string ~loc () ) :: result_types)
508
513
| Arg_cst _
@@ -1020,7 +1025,7 @@ let pval_prim_of_option_labels
1020
1025
let label_name = Lam_methname. translate p.txt in
1021
1026
let obj_arg_label =
1022
1027
if is_option then
1023
- External_arg_spec. optional label_name
1028
+ External_arg_spec. optional false label_name
1024
1029
else External_arg_spec. obj_label label_name
1025
1030
in
1026
1031
{obj_arg_type = Nothing ;
0 commit comments