Skip to content

Commit b48b85c

Browse files
authored
Merge pull request #2711 from cristianoc/remove_warning_on_ocaml_bools_in_ffi
Delete warning “You are passing a OCaml bool type into JS”.
2 parents 32750c5 + 7a8e554 commit b48b85c

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

jscomp/common/bs_warnings.ml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424

2525

2626

27-
type t =
28-
| Unsafe_ffi_bool_type
29-
27+
type t =
3028
| Unsafe_poly_variant_type
3129
(* for users write code like this:
3230
{[ external f : [`a of int ] -> string = ""]}
@@ -37,9 +35,6 @@ type t =
3735

3836
let to_string t =
3937
match t with
40-
| Unsafe_ffi_bool_type
41-
->
42-
"You are passing a OCaml bool type into JS, probably you want to pass Js.boolean"
4338
| Unsafe_poly_variant_type
4439
->
4540
"Here a OCaml polymorphic variant type passed into JS, probably you forgot annotations like `[@bs.int]` or `[@bs.string]` "

jscomp/common/bs_warnings.mli

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

2525

26-
type t =
27-
| Unsafe_ffi_bool_type
26+
type t =
2827
| Unsafe_poly_variant_type
2928

3029
val prerr_bs_ffi_warning : Location.t -> t -> unit

jscomp/syntax/external_process.ml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,6 @@ let get_arg_type ~nolabel optional
151151
end, {ptyp with ptyp_attributes})
152152
| (`Nothing, ptyp_attributes) ->
153153
begin match ptyp_desc with
154-
| Ptyp_constr ({txt = Lident "bool"; _}, [])
155-
->
156-
Bs_warnings.prerr_bs_ffi_warning ptyp.ptyp_loc Unsafe_ffi_bool_type;
157-
Nothing
158154
| Ptyp_constr ({txt = Lident "unit"; _}, [])
159155
-> if nolabel then Extern_unit else Nothing
160156
| Ptyp_constr ({txt = Lident "array"; _}, [_])

0 commit comments

Comments
 (0)