diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stdlib/src/erl_lint.erl | 3 | ||||
-rw-r--r-- | lib/stdlib/test/erl_lint_SUITE.erl | 18 |
2 files changed, 18 insertions, 3 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl index 573b05e4e2..b6ab39251a 100644 --- a/lib/stdlib/src/erl_lint.erl +++ b/lib/stdlib/src/erl_lint.erl @@ -3238,7 +3238,8 @@ modify_line(T, F0) -> %% Forms. modify_line1({function,F,A}, _Mf) -> {function,F,A}; -modify_line1({function,M,F,A}, _Mf) -> {function,M,F,A}; +modify_line1({function,M,F,A}, Mf) -> + {function,modify_line1(M, Mf),modify_line1(F, Mf),modify_line1(A, Mf)}; modify_line1({attribute,L,record,{Name,Fields}}, Mf) -> {attribute,Mf(L),record,{Name,modify_line1(Fields, Mf)}}; modify_line1({attribute,L,spec,{Fun,Types}}, Mf) -> diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index b1236ceedf..fdaab2ee30 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -51,7 +51,7 @@ unsized_binary_in_bin_gen_pattern/1, guard/1, otp_4886/1, otp_4988/1, otp_5091/1, otp_5276/1, otp_5338/1, otp_5362/1, otp_5371/1, otp_7227/1, otp_5494/1, otp_5644/1, otp_5878/1, - otp_5917/1, otp_6585/1, otp_6885/1, otp_10436/1, + otp_5917/1, otp_6585/1, otp_6885/1, otp_10436/1, otp_11254/1, export_all/1, bif_clash/1, behaviour_basic/1, behaviour_multiple/1, @@ -84,7 +84,7 @@ all() -> unsized_binary_in_bin_gen_pattern, otp_4886, otp_4988, otp_5091, otp_5276, otp_5338, otp_5362, otp_5371, otp_7227, otp_5494, otp_5644, - otp_5878, otp_5917, otp_6585, otp_6885, otp_10436, export_all, + otp_5878, otp_5917, otp_6585, otp_6885, otp_10436, otp_11254,export_all, bif_clash, behaviour_basic, behaviour_multiple, otp_7550, otp_8051, format_warn, {group, on_load}, too_many_arguments, basic_errors, bin_syntax_errors]. @@ -2449,6 +2449,20 @@ otp_10436(Config) when is_list(Config) -> run_test2(Config, Ts2, []), ok. +otp_11254(doc) -> + "OTP-11254. Warnings for opaque types."; +otp_11254(suite) -> []; +otp_11254(Config) when is_list(Config) -> + Ts = <<"-module(p2). + -export([manifest/2]). + manifest(Module, Name) -> + fun Module:Nine/1. + ">>, + {error,[{4,erl_lint,{unbound_var,'Nine'}}], + [{3,erl_lint,{unused_var,'Name'}}]} = + run_test2(Config, Ts, []), + ok. + export_all(doc) -> "OTP-7392. Warning for export_all."; export_all(Config) when is_list(Config) -> |