Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions jscomp/common/bs_warnings.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""]}
Expand All @@ -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]` "
Expand Down
3 changes: 1 addition & 2 deletions jscomp/common/bs_warnings.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions jscomp/syntax/external_process.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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"; _}, [_])
Expand Down