From 7a8e5549ea78f89700e1beb57c1acfa6fdc0d88a Mon Sep 17 00:00:00 2001 From: Cristiano Calcagno Date: Wed, 4 Apr 2018 15:17:36 +0200 Subject: [PATCH] =?UTF-8?q?Delete=20warning=20=E2=80=9CYou=20are=20passing?= =?UTF-8?q?=20a=20OCaml=20bool=20type=20into=20JS=E2=80=9D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The warning "You are passing a OCaml bool type into JS, probably you want to pass Js.boolean" can be deleted now that Js.boolean is the same as bool. --- jscomp/common/bs_warnings.ml | 7 +------ jscomp/common/bs_warnings.mli | 3 +-- jscomp/syntax/external_process.ml | 4 ---- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/jscomp/common/bs_warnings.ml b/jscomp/common/bs_warnings.ml index 2282878632..fe85c67109 100644 --- a/jscomp/common/bs_warnings.ml +++ b/jscomp/common/bs_warnings.ml @@ -24,9 +24,7 @@ -type t = - | Unsafe_ffi_bool_type - +type t = | Unsafe_poly_variant_type (* for users write code like this: {[ external f : [`a of int ] -> string = ""]} @@ -37,9 +35,6 @@ type t = let to_string t = match t with - | Unsafe_ffi_bool_type - -> - "You are passing a OCaml bool type into JS, probably you want to pass Js.boolean" | Unsafe_poly_variant_type -> "Here a OCaml polymorphic variant type passed into JS, probably you forgot annotations like `[@bs.int]` or `[@bs.string]` " diff --git a/jscomp/common/bs_warnings.mli b/jscomp/common/bs_warnings.mli index dbfd8f0c17..90c474df22 100644 --- a/jscomp/common/bs_warnings.mli +++ b/jscomp/common/bs_warnings.mli @@ -23,8 +23,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) -type t = - | Unsafe_ffi_bool_type +type t = | Unsafe_poly_variant_type val prerr_bs_ffi_warning : Location.t -> t -> unit diff --git a/jscomp/syntax/external_process.ml b/jscomp/syntax/external_process.ml index 4ccdd8a7ed..11e796e0ec 100644 --- a/jscomp/syntax/external_process.ml +++ b/jscomp/syntax/external_process.ml @@ -151,10 +151,6 @@ let get_arg_type ~nolabel optional end, {ptyp with ptyp_attributes}) | (`Nothing, ptyp_attributes) -> begin match ptyp_desc with - | Ptyp_constr ({txt = Lident "bool"; _}, []) - -> - Bs_warnings.prerr_bs_ffi_warning ptyp.ptyp_loc Unsafe_ffi_bool_type; - Nothing | Ptyp_constr ({txt = Lident "unit"; _}, []) -> if nolabel then Extern_unit else Nothing | Ptyp_constr ({txt = Lident "array"; _}, [_])