@@ -416,30 +416,30 @@ let process_obj
416
416
else
417
417
Location. raise_errorf ~loc " expect label, optional, or unit here"
418
418
| Labelled name ->
419
- let new_ty, arg_type = refine_arg_type ~nolabel: false ty in
420
- begin match arg_type with
419
+ let new_ty, obj_arg_type = refine_arg_type ~nolabel: false ty in
420
+ begin match obj_arg_type with
421
421
| Ignore ->
422
- External_arg_spec. empty_kind arg_type ,
422
+ External_arg_spec. empty_kind obj_arg_type ,
423
423
{param_type with ty = new_ty}::arg_types, result_types
424
424
| Arg_cst i ->
425
425
let s = Lam_methname. translate name in
426
- {arg_label = External_arg_spec. label s (Some i);
427
- arg_type },
426
+ {obj_arg_label = External_arg_spec. label s (Some i);
427
+ obj_arg_type },
428
428
arg_types, (* ignored in [arg_types], reserved in [result_types] *)
429
429
(({Asttypes. txt = name; loc} , [] , new_ty) :: result_types)
430
430
| Nothing ->
431
431
let s = (Lam_methname. translate name) in
432
- {arg_label = External_arg_spec. label s None ; arg_type },
432
+ {obj_arg_label = External_arg_spec. label s None ; obj_arg_type },
433
433
{param_type with ty = new_ty}::arg_types,
434
434
(({Asttypes. txt = name; loc} , [] , new_ty) :: result_types)
435
435
| Int _ ->
436
436
let s = Lam_methname. translate name in
437
- {arg_label = External_arg_spec. label s None ; arg_type },
437
+ {obj_arg_label = External_arg_spec. label s None ; obj_arg_type },
438
438
{param_type with ty = new_ty}::arg_types,
439
439
(({Asttypes. txt = name; loc}, [] , Ast_literal. type_int ~loc () ) :: result_types)
440
440
| NullString _ ->
441
441
let s = Lam_methname. translate name in
442
- {arg_label = External_arg_spec. label s None ; arg_type },
442
+ {obj_arg_label = External_arg_spec. label s None ; obj_arg_type },
443
443
{param_type with ty = new_ty }::arg_types,
444
444
(({Asttypes. txt = name; loc}, [] , Ast_literal. type_string ~loc () ) :: result_types)
445
445
| Fn_uncurry_arity _ ->
@@ -455,24 +455,24 @@ let process_obj
455
455
" bs.obj label %s does not support [@bs.unwrap] arguments" name
456
456
end
457
457
| Optional name ->
458
- let arg_type = get_opt_arg_type ~nolabel: false ty in
459
- begin match arg_type with
458
+ let obj_arg_type = get_opt_arg_type ~nolabel: false ty in
459
+ begin match obj_arg_type with
460
460
| Ignore ->
461
- External_arg_spec. empty_kind arg_type ,
461
+ External_arg_spec. empty_kind obj_arg_type ,
462
462
param_type::arg_types, result_types
463
463
| Nothing ->
464
464
let s = (Lam_methname. translate name) in
465
- {arg_label = External_arg_spec. optional s; arg_type },
465
+ {obj_arg_label = External_arg_spec. optional s; obj_arg_type },
466
466
param_type :: arg_types,
467
467
( ({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc ty) :: result_types)
468
468
| Int _ ->
469
469
let s = Lam_methname. translate name in
470
- {arg_label = External_arg_spec. optional s ; arg_type },
470
+ {obj_arg_label = External_arg_spec. optional s ; obj_arg_type },
471
471
param_type :: arg_types,
472
472
(({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc @@ Ast_literal. type_int ~loc () ) :: result_types)
473
473
| NullString _ ->
474
474
let s = Lam_methname. translate name in
475
- {arg_label = External_arg_spec. optional s ; arg_type },
475
+ {obj_arg_label = External_arg_spec. optional s ; obj_arg_type },
476
476
param_type::arg_types,
477
477
(({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc @@ Ast_literal. type_string ~loc () ) :: result_types)
478
478
| Arg_cst _
@@ -966,11 +966,11 @@ let pval_prim_of_labels (labels : string Asttypes.loc list) =
966
966
Ext_list. fold_right labels ([] : External_arg_spec.obj_params )
967
967
(fun {loc ; txt } arg_kinds
968
968
->
969
- let arg_label =
969
+ let obj_arg_label =
970
970
External_arg_spec. label
971
971
(Lam_methname. translate txt) None in
972
- {arg_type = Nothing ;
973
- arg_label } :: arg_kinds
972
+ {obj_arg_type = Nothing ;
973
+ obj_arg_label } :: arg_kinds
974
974
) in
975
975
let encoding =
976
976
External_ffi_types. to_string (Ffi_obj_create arg_kinds) in
@@ -988,13 +988,13 @@ let pval_prim_of_option_labels
988
988
(fun (is_option ,{loc ; txt } ) arg_kinds
989
989
->
990
990
let label_name = Lam_methname. translate txt in
991
- let arg_label =
991
+ let obj_arg_label =
992
992
if is_option then
993
993
External_arg_spec. optional label_name
994
994
else External_arg_spec. label label_name None
995
995
in
996
- {arg_type = Nothing ;
997
- arg_label } :: arg_kinds) in
996
+ {obj_arg_type = Nothing ;
997
+ obj_arg_label } :: arg_kinds) in
998
998
let encoding =
999
999
External_ffi_types. to_string (Ffi_obj_create arg_kinds) in
1000
1000
[" " ; encoding]
0 commit comments