aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-06-07 14:15:11 +0200
committerBjörn Gustavsson <[email protected]>2010-06-09 11:57:27 +0200
commit1ed6388948312bc163b5d391f39a30ae9bc56207 (patch)
tree2c88b7a7d312cd66a3a5ca09f392b97652252fbe /lib/stdlib/test
parent5e354ca66996ee03d615dc36c284e94ccf176e89 (diff)
downloadotp-1ed6388948312bc163b5d391f39a30ae9bc56207.tar.gz
otp-1ed6388948312bc163b5d391f39a30ae9bc56207.tar.bz2
otp-1ed6388948312bc163b5d391f39a30ae9bc56207.zip
Correct warnings and errors for auto-imported bif clashes
warn_unused_import works correctly (does not give warnings when overridden). Local call in guard gives its own error pointing out the local/imported function. Use of the phrase "overridden auto-imported bif" instead of "redefined auto-imported bif" in textual error messages.
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/erl_lint_SUITE.erl15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index 01f494ee38..d0c0d68b4a 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -2252,7 +2252,7 @@ otp_5878(Config) when is_list(Config) ->
{15,erl_lint,{undefined_field,r3,q}},
{17,erl_lint,{undefined_field,r,q}},
{21,erl_lint,illegal_guard_expr},
- {23,erl_lint,illegal_guard_expr}],
+ {23,erl_lint,{illegal_guard_local_call,{l,0}}}],
[]} =
run_test2(Config, Ill1, [warn_unused_record]),
@@ -2492,7 +2492,7 @@ bif_clash(Config) when is_list(Config) ->
binary:part(B,X,Y).
">>,
[],
- {errors,[{3,erl_lint,illegal_guard_expr}],[]}},
+ {errors,[{3,erl_lint,{illegal_guard_local_call,{binary_part,2}}}],[]}},
%% no_auto_import is not like nowarn_bif_clash, it actually removes the autoimport
{clash9,
<<"-export([x/1]).
@@ -2599,7 +2599,16 @@ bif_clash(Config) when is_list(Config) ->
binary_part(A,B,C+1).
">>,
[],
- {errors,[{4,erl_lint,illegal_guard_expr}],[]}}
+ {errors,[{4,erl_lint,illegal_guard_expr}],[]}},
+ %% Not with local functions either
+ {clash20,
+ <<"-export([binary_port/3]).
+ -import(x,[binary_part/3]).
+ binary_port(A,B,C) ->
+ binary_part(A,B,C).
+ ">>,
+ [warn_unused_import],
+ {warnings,[{2,erl_lint,{redefine_bif_import,{binary_part,3}}}]}}
],
?line [] = run(Config, Ts),