@@ -400,7 +400,7 @@ let process_obj
400400 } ->
401401 if String. length prim_name <> 0 then
402402 Location. raise_errorf ~loc " [@@bs.obj] expect external names to be empty string" ;
403- let arg_kinds, new_arg_types_ty, result_types =
403+ let arg_kinds, new_arg_types_ty, ( result_types : Parsetree.object_field list ) =
404404 Ext_list. fold_right arg_types_ty ( [] , [] , [] )
405405 (fun param_type ( arg_labels , (arg_types : Ast_compatible.param_type list ), result_types ) ->
406406 let arg_label = param_type.label in
@@ -426,22 +426,22 @@ let process_obj
426426 {obj_arg_label = External_arg_spec. obj_label s;
427427 obj_arg_type },
428428 arg_types, (* ignored in [arg_types], reserved in [result_types] *)
429- (({Asttypes. txt = name; loc} , [] , new_ty) :: result_types)
429+ (Parsetree. Otag ({Asttypes. txt = name; loc} , [] , new_ty) :: result_types)
430430 | Nothing ->
431431 let s = (Lam_methname. translate name) in
432432 {obj_arg_label = External_arg_spec. obj_label s ; obj_arg_type },
433433 {param_type with ty = new_ty}::arg_types,
434- (({Asttypes. txt = name; loc} , [] , new_ty) :: result_types)
434+ (Otag ({Asttypes. txt = name; loc} , [] , new_ty) :: result_types)
435435 | Int _ ->
436436 let s = Lam_methname. translate name in
437437 {obj_arg_label = External_arg_spec. obj_label s; obj_arg_type},
438438 {param_type with ty = new_ty}::arg_types,
439- (({Asttypes. txt = name; loc}, [] , Ast_literal. type_int ~loc () ) :: result_types)
439+ (Otag ({Asttypes. txt = name; loc}, [] , Ast_literal. type_int ~loc () ) :: result_types)
440440 | Poly_var_string _ ->
441441 let s = Lam_methname. translate name in
442442 {obj_arg_label = External_arg_spec. obj_label s; obj_arg_type},
443443 {param_type with ty = new_ty }::arg_types,
444- (({Asttypes. txt = name; loc}, [] , Ast_literal. type_string ~loc () ) :: result_types)
444+ (Otag ({Asttypes. txt = name; loc}, [] , Ast_literal. type_string ~loc () ) :: result_types)
445445 | Fn_uncurry_arity _ ->
446446 Location. raise_errorf ~loc
447447 " The combination of [@@bs.obj], [@@bs.uncurry] is not supported yet"
@@ -464,17 +464,17 @@ let process_obj
464464 let s = (Lam_methname. translate name) in
465465 {obj_arg_label = External_arg_spec. optional s; obj_arg_type},
466466 param_type :: arg_types,
467- ( ({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc ty) :: result_types)
467+ ( Parsetree. Otag ({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc ty) :: result_types)
468468 | Int _ ->
469469 let s = Lam_methname. translate name in
470470 {obj_arg_label = External_arg_spec. optional s ; obj_arg_type },
471471 param_type :: arg_types,
472- (({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc @@ Ast_literal. type_int ~loc () ) :: result_types)
472+ (Otag ({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc @@ Ast_literal. type_int ~loc () ) :: result_types)
473473 | Poly_var_string _ ->
474474 let s = Lam_methname. translate name in
475475 {obj_arg_label = External_arg_spec. optional s ; obj_arg_type },
476476 param_type::arg_types,
477- (({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc @@ Ast_literal. type_string ~loc () ) :: result_types)
477+ (Otag ({Asttypes. txt = name; loc}, [] , Ast_comb. to_undefined_type loc @@ Ast_literal. type_string ~loc () ) :: result_types)
478478 | Arg_cst _
479479 ->
480480 Location. raise_errorf ~loc " bs.as is not supported with optional yet"
0 commit comments