Skip to content

Commit e3d8381

Browse files
committed
[compiler] add two warning numbers 101, 102
1 parent 746ff7c commit e3d8381

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

vendor/ocaml/utils/warnings.ml

+16-3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ type t =
6868
| Eliminated_optional_arguments of string list (* 48 *)
6969
| No_cmi_file of string (* 49 *)
7070
| Bad_docstring of bool (* 50 *)
71+
72+
| Bs_unused_attribute of string (* 101 *)
73+
| Bs_polymorphic_comparison (* 102 *)
7174
;;
7275

7376
(* If you remove a warning, leave a hole in the numbering. NEVER change
@@ -127,15 +130,20 @@ let number = function
127130
| Eliminated_optional_arguments _ -> 48
128131
| No_cmi_file _ -> 49
129132
| Bad_docstring _ -> 50
133+
134+
| Bs_unused_attribute _ -> 101
135+
| Bs_polymorphic_comparison -> 102
130136
;;
131137

132-
let last_warning_number = 50
138+
let last_warning_number = 102
133139
(* Must be the max number returned by the [number] function. *)
140+
let letter_all =
141+
let rec loop i = if i = 0 then [] else i :: loop (i - 1) in
142+
loop last_warning_number
134143

135144
let letter = function
136145
| 'a' ->
137-
let rec loop i = if i = 0 then [] else i :: loop (i - 1) in
138-
loop last_warning_number
146+
letter_all
139147
| 'b' -> []
140148
| 'c' -> [1; 2]
141149
| 'd' -> [3]
@@ -389,6 +397,10 @@ let message = function
389397
| Bad_docstring unattached ->
390398
if unattached then "unattached documentation comment (ignored)"
391399
else "ambiguous documentation comment"
400+
| Bs_unused_attribute s ->
401+
"Unused bucklescript attribute: " ^ s
402+
| Bs_polymorphic_comparison ->
403+
"polymorphic comparison introduced (maybe unsafe)"
392404
;;
393405

394406
let nerrors = ref 0;;
@@ -485,6 +497,7 @@ let descriptions =
485497
48, "Implicit elimination of optional arguments.";
486498
49, "Missing cmi file when looking up module alias.";
487499
50, "Unexpected documentation comment.";
500+
101,"Unused bs attributes";
488501
]
489502
;;
490503

vendor/ocaml/utils/warnings.mli

+3
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ type t =
6363
| Eliminated_optional_arguments of string list (* 48 *)
6464
| No_cmi_file of string (* 49 *)
6565
| Bad_docstring of bool (* 50 *)
66+
67+
| Bs_unused_attribute of string (* 101 *)
68+
| Bs_polymorphic_comparison (* 102 *)
6669
;;
6770

6871
val parse_options : bool -> string -> unit;;

0 commit comments

Comments
 (0)