Skip to content

Commit d70b5e9

Browse files
committed
add a warning number 101: for bs unused attribute
1 parent e3d8381 commit d70b5e9

22 files changed

+2171
-2180
lines changed

jscomp/all.depend

+3-3
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ syntax/ast_derive.cmx : ext/string_map.cmx ext/literals.cmx \
203203
syntax/ast_derive.cmi
204204
syntax/ast_comb.cmx : ext/ext_list.cmx syntax/ast_literal.cmx \
205205
syntax/ast_comb.cmi
206-
syntax/ast_attributes.cmx : ext/ext_string.cmx common/bs_warnings.cmx \
207-
syntax/bs_syntaxerr.cmx syntax/ast_payload.cmx syntax/ast_attributes.cmi
206+
syntax/ast_attributes.cmx : ext/ext_string.cmx syntax/bs_syntaxerr.cmx \
207+
syntax/ast_payload.cmx syntax/ast_attributes.cmi
208208
syntax/ast_core_type.cmx : ext/ext_list.cmx syntax/bs_syntaxerr.cmx \
209209
syntax/ast_comb.cmx syntax/ast_core_type.cmi
210210
syntax/ast_derive_dyn.cmx : ext/ext_list.cmx syntax/bs_syntaxerr.cmx \
@@ -777,7 +777,7 @@ ounit_tests/ounit_ident_mask_tests.cmx : ounit/oUnit.cmx \
777777
ounit_tests/ounit_cmd_util.cmx : ext/literals.cmx \
778778
ounit_tests/ounit_cmd_util.cmi
779779
ounit_tests/ounit_cmd_tests.cmx : ounit_tests/ounit_cmd_util.cmx \
780-
ounit/oUnit.cmx ext/literals.cmx ext/ext_string.cmx
780+
ounit/oUnit.cmx ext/ext_string.cmx
781781
ounit_tests/ounit_ffi_error_debug_test.cmx : ounit_tests/ounit_cmd_util.cmx \
782782
ounit/oUnit.cmx ext/ext_string.cmx
783783
ounit_tests/ounit_unicode_tests.cmx : ounit/oUnit.cmx ext/ext_string.cmx \

jscomp/bin/all_ounit_tests.ml

+8-2
Original file line numberDiff line numberDiff line change
@@ -5282,9 +5282,15 @@ let suites =
52825282
bsc_check_eval {|let bla4 foo x y= foo##(method1 x y [@bs]) |} in
52835283
(* debug_output should_be_warning; *)
52845284
OUnit.assert_bool __LOC__ (Ext_string.contain_substring
5285-
should_be_warning.stderr Literals.unused_attribute)
5285+
should_be_warning.stderr "Unused")
52865286
end;
5287-
5287+
__LOC__ >:: begin fun _ ->
5288+
let should_be_warning =
5289+
bsc_check_eval {| external mk : int -> ([`a|`b [@bs.string]]) = "" [@@bs.val] |} in
5290+
OUnit.assert_bool __LOC__
5291+
(Ext_string.contain_substring
5292+
should_be_warning.stderr "Unused")
5293+
end;
52885294
__LOC__ >:: begin fun _ ->
52895295
let should_err = bsc_check_eval {|
52905296
external ff :

jscomp/bin/bsb.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9654,7 +9654,7 @@ type t = {
96549654
error : warning_error
96559655
}
96569656

9657-
let default_warning_flag = "-w -30-40+6+7+27+32..39+44+45"
9657+
let default_warning_flag = "-w -30-40+6+7+27+32..39+44+45+101"
96589658

96599659
let get_warning_flag x =
96609660
default_warning_flag ^

0 commit comments

Comments
 (0)