@@ -416,30 +416,30 @@ let process_obj
416416 else
417417 Location. raise_errorf ~loc " expect label, optional, or unit here"
418418 | 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
421421 | Ignore ->
422- External_arg_spec. empty_kind arg_type ,
422+ External_arg_spec. empty_kind obj_arg_type ,
423423 {param_type with ty = new_ty}::arg_types, result_types
424424 | Arg_cst i ->
425425 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 },
428428 arg_types, (* ignored in [arg_types], reserved in [result_types] *)
429429 (({Asttypes. txt = name; loc} , [] , new_ty) :: result_types)
430430 | Nothing ->
431431 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 },
433433 {param_type with ty = new_ty}::arg_types,
434434 (({Asttypes. txt = name; loc} , [] , new_ty) :: result_types)
435435 | Int _ ->
436436 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 },
438438 {param_type with ty = new_ty}::arg_types,
439439 (({Asttypes. txt = name; loc}, [] , Ast_literal. type_int ~loc () ) :: result_types)
440440 | NullString _ ->
441441 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 },
443443 {param_type with ty = new_ty }::arg_types,
444444 (({Asttypes. txt = name; loc}, [] , Ast_literal. type_string ~loc () ) :: result_types)
445445 | Fn_uncurry_arity _ ->
@@ -455,24 +455,24 @@ let process_obj
455455 " bs.obj label %s does not support [@bs.unwrap] arguments" name
456456 end
457457 | 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
460460 | Ignore ->
461- External_arg_spec. empty_kind arg_type ,
461+ External_arg_spec. empty_kind obj_arg_type ,
462462 param_type::arg_types, result_types
463463 | Nothing ->
464464 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 },
466466 param_type :: arg_types,
467467 ( ({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc ty) :: result_types)
468468 | Int _ ->
469469 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 },
471471 param_type :: arg_types,
472472 (({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc @@ Ast_literal. type_int ~loc () ) :: result_types)
473473 | NullString _ ->
474474 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 },
476476 param_type::arg_types,
477477 (({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc @@ Ast_literal. type_string ~loc () ) :: result_types)
478478 | Arg_cst _
@@ -966,11 +966,11 @@ let pval_prim_of_labels (labels : string Asttypes.loc list) =
966966 Ext_list. fold_right labels ([] : External_arg_spec.obj_params )
967967 (fun {loc ; txt } arg_kinds
968968 ->
969- let arg_label =
969+ let obj_arg_label =
970970 External_arg_spec. label
971971 (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
974974 ) in
975975 let encoding =
976976 External_ffi_types. to_string (Ffi_obj_create arg_kinds) in
@@ -988,13 +988,13 @@ let pval_prim_of_option_labels
988988 (fun (is_option ,{loc ; txt } ) arg_kinds
989989 ->
990990 let label_name = Lam_methname. translate txt in
991- let arg_label =
991+ let obj_arg_label =
992992 if is_option then
993993 External_arg_spec. optional label_name
994994 else External_arg_spec. label label_name None
995995 in
996- {arg_type = Nothing ;
997- arg_label } :: arg_kinds) in
996+ {obj_arg_type = Nothing ;
997+ obj_arg_label } :: arg_kinds) in
998998 let encoding =
999999 External_ffi_types. to_string (Ffi_obj_create arg_kinds) in
10001000 [" " ; encoding]
0 commit comments