diff options
author | Björn Gustavsson <[email protected]> | 2018-11-22 16:12:41 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-11-22 16:12:41 +0100 |
commit | 9ac4cc58aaa1cf190ca1f69f1b578eaba6b1f671 (patch) | |
tree | cde13c5335285a824685e157d5c8bbd68cb20c19 /lib/stdlib/test | |
parent | 253d146786dc2068de724bb36f61d6d24c4d460b (diff) | |
parent | c5de54bdf5f47212b34c744b976c23e193e75fb9 (diff) | |
download | otp-9ac4cc58aaa1cf190ca1f69f1b578eaba6b1f671.tar.gz otp-9ac4cc58aaa1cf190ca1f69f1b578eaba6b1f671.tar.bz2 otp-9ac4cc58aaa1cf190ca1f69f1b578eaba6b1f671.zip |
Merge branch 'maint'
* maint:
Fix inadvertently suppressed warning for unused variable
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r-- | lib/stdlib/test/erl_lint_SUITE.erl | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index c1613a7273..e6ed55bf2d 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -67,7 +67,8 @@ record_errors/1, otp_11879_cont/1, non_latin1_module/1, otp_14323/1, stacktrace_syntax/1, - otp_14285/1, otp_14378/1]). + otp_14285/1, otp_14378/1, + external_funs/1]). suite() -> [{ct_hooks,[ts_install_cth]}, @@ -88,7 +89,7 @@ all() -> maps, maps_type, maps_parallel_match, otp_11851, otp_11879, otp_13230, record_errors, otp_11879_cont, non_latin1_module, otp_14323, - stacktrace_syntax, otp_14285, otp_14378]. + stacktrace_syntax, otp_14285, otp_14378, external_funs]. groups() -> [{unused_vars_warn, [], @@ -4134,6 +4135,21 @@ otp_14285(Config) -> run(Config, Ts), ok. +external_funs(Config) when is_list(Config) -> + Ts = [{external_funs_1, + %% ERL-762: Unused variable warning not being emitted. + <<"f() -> + BugVar = process_info(self()), + if true -> fun m:f/1 end. + f(M, F) -> + BugVar = process_info(self()), + if true -> fun M:F/1 end.">>, + [], + {warnings,[{2,erl_lint,{unused_var,'BugVar'}}, + {5,erl_lint,{unused_var,'BugVar'}}]}}], + run(Config, Ts), + ok. + format_error(E) -> lists:flatten(erl_lint:format_error(E)). |