@@ -404951,9 +404951,10 @@ let eraseTypeStr =
404951
404951
)
404952
404952
let unsafeIndex = "_index"
404953
404953
let unsafeIndexGet =
404954
+ let any = Typ.any () in
404954
404955
Str.primitive
404955
404956
(Val.mk ~prim:[""] {loc = noloc; txt = unsafeIndex} ~attrs:[Ast_attributes.bs_get_index]
404956
- (Ast_compatible.arrow (Typ.var "b") (Ast_compatible.arrow (Typ.var "a") (Typ.var "c") ))
404957
+ (Ast_compatible.arrow any (Ast_compatible.arrow any any ))
404957
404958
)
404958
404959
let unsafeIndexGetExp = (Exp.ident {loc = noloc; txt = Lident unsafeIndex})
404959
404960
(* JavaScript has allowed trailing commas in array literals since the beginning,
@@ -406021,21 +406022,24 @@ let refine_arg_type ~(nolabel:bool) (ptyp : Ast_core_type.t)
406021
406022
(if ptyp.ptyp_desc = Ptyp_any then
406022
406023
let ptyp_attrs = ptyp.ptyp_attributes in
406023
406024
let result = Ast_attributes.iter_process_bs_string_or_int_as ptyp_attrs in
406024
- (* when ppx start dropping attributes
406025
- we should warn, there is a trade off whether
406026
- we should warn dropped non bs attribute or not
406027
- *)
406028
- Bs_ast_invariant.warn_discarded_unused_attributes ptyp_attrs;
406029
406025
match result with
406030
406026
| None ->
406031
- Bs_syntaxerr.err ptyp.ptyp_loc Invalid_underscore_type_in_external
406032
- | Some (Int i) -> (* (_[@bs.as ])*)
406033
- (* This type is used in bs.obj only to construct obj type*)
406034
- Arg_cst(External_arg_spec.cst_int i)
406035
- | Some (Str i)->
406036
- Arg_cst (External_arg_spec.cst_string i)
406037
- | Some (Js_literal_str s) ->
406038
- Arg_cst (External_arg_spec.cst_obj_literal s)
406027
+ spec_of_ptyp nolabel ptyp
406028
+ | Some cst -> (* (_[@bs.as ])*)
406029
+ (* when ppx start dropping attributes
406030
+ we should warn, there is a trade off whether
406031
+ we should warn dropped non bs attribute or not
406032
+ *)
406033
+ Bs_ast_invariant.warn_discarded_unused_attributes ptyp_attrs;
406034
+ begin match cst with
406035
+ | Int i ->
406036
+ (* This type is used in bs.obj only to construct obj type*)
406037
+ Arg_cst(External_arg_spec.cst_int i)
406038
+ | Str i->
406039
+ Arg_cst (External_arg_spec.cst_string i)
406040
+ | Js_literal_str s ->
406041
+ Arg_cst (External_arg_spec.cst_obj_literal s)
406042
+ end
406039
406043
else (* ([`a|`b] [@bs.string]) *)
406040
406044
spec_of_ptyp nolabel ptyp
406041
406045
)
0 commit comments