@@ -97,7 +97,7 @@ let spec_of_ptyp
97
97
*)
98
98
let refine_arg_type ~(nolabel :bool ) (ptyp : Ast_core_type.t )
99
99
: Ast_core_type.t * External_arg_spec.attr =
100
- if Ast_core_type. is_any ptyp then (* (_[@bs.as ]) *)
100
+ if ptyp.ptyp_desc = Ptyp_any then
101
101
let ptyp_attrs = ptyp.ptyp_attributes in
102
102
let result = Ast_attributes. iter_process_bs_string_or_int_as ptyp_attrs in
103
103
(* when ppx start dropping attributes
@@ -108,7 +108,7 @@ let refine_arg_type ~(nolabel:bool) (ptyp : Ast_core_type.t)
108
108
match result with
109
109
| None ->
110
110
Bs_syntaxerr. err ptyp.ptyp_loc Invalid_underscore_type_in_external
111
- | Some (Int i ) ->
111
+ | Some (Int i ) -> (* (_[@bs.as ]) *)
112
112
(* This type is used in bs.obj only to construct obj type*)
113
113
Ast_literal. type_int ~loc: ptyp.ptyp_loc () , Arg_cst (External_arg_spec. cst_int i)
114
114
| Some (Str i )->
@@ -133,7 +133,7 @@ let get_opt_arg_type
133
133
~(nolabel : bool )
134
134
(ptyp : Ast_core_type.t ) :
135
135
External_arg_spec. attr =
136
- if Ast_core_type. is_any ptyp then (* (_[@bs.as ])*)
136
+ if ptyp.ptyp_desc = Ptyp_any then (* (_[@bs.as ])*)
137
137
(* extenral f : ?x:_ -> y:int -> _ = "" [@@bs.obj] is not allowed *)
138
138
Bs_syntaxerr. err ptyp.ptyp_loc Invalid_underscore_type_in_external ;
139
139
(* ([`a|`b] [@bs.string]) *)
@@ -496,7 +496,7 @@ let process_obj
496
496
output_tys) in
497
497
498
498
let result =
499
- if Ast_core_type. is_any result_type then
499
+ if result_type.ptyp_desc = Ptyp_any then
500
500
Ast_core_type. make_obj ~loc result_types
501
501
else
502
502
fst (refine_arg_type ~nolabel: true result_type)
@@ -882,7 +882,7 @@ let handle_attributes
882
882
Location. raise_errorf ~loc " [@@@@bs.splice] expect the last type to be a non optional"
883
883
| Labelled _ | Nolabel
884
884
->
885
- if Ast_core_type. is_any ty then
885
+ if ty.ptyp_desc = Ptyp_any then
886
886
Location. raise_errorf ~loc " [@@@@bs.splice] expect the last type to be an array" ;
887
887
if spec_of_ptyp true ty <> Nothing then
888
888
Location. raise_errorf ~loc " [@@@@bs.splice] expect the last type to be an array" ;
0 commit comments