aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/erl_lint_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-01-26 10:43:49 +0100
committerBjörn Gustavsson <[email protected]>2012-01-26 10:43:49 +0100
commit0ea66a32ea84121bd0b7a8e7aed743b2c4593ec6 (patch)
tree744ceaaa73408578a26171118a9aa09ac8311144 /lib/stdlib/test/erl_lint_SUITE.erl
parent716f6e4c99dd03ee48087bbebe37bfb42c08835e (diff)
parent9d2a2e3db06e861045e51ca3cc8adb9cf8fc467d (diff)
downloadotp-0ea66a32ea84121bd0b7a8e7aed743b2c4593ec6.tar.gz
otp-0ea66a32ea84121bd0b7a8e7aed743b2c4593ec6.tar.bz2
otp-0ea66a32ea84121bd0b7a8e7aed743b2c4593ec6.zip
Merge branch 'maint'
* maint: Update primary bootstrap erl_lint: Disallow call to is_record/3 if there is a local is_record/3 Fix crash in trace_info({M,F,A}, Flags) when M:F/A has native code Ensure that generated record operations don't call local functions
Diffstat (limited to 'lib/stdlib/test/erl_lint_SUITE.erl')
-rw-r--r--lib/stdlib/test/erl_lint_SUITE.erl23
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index e4c7fd5b02..4e93f056ad 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -2633,22 +2633,33 @@ bif_clash(Config) when is_list(Config) ->
[warn_unused_import],
{warnings,[{2,erl_lint,{redefine_bif_import,{binary_part,3}}}]}},
%% Don't accept call to a guard BIF if there is a local definition
- %% or an import with the same name.
+ %% or an import with the same name. Note: is_record/2 is an
+ %% exception, since it is more of syntatic sugar than a real BIF.
{clash21,
<<"-export([is_list/1]).
-import(x, [is_tuple/1]).
+ -record(r, {a,b}).
x(T) when is_tuple(T) -> ok;
x(T) when is_list(T) -> ok.
y(T) when is_tuple(T) =:= true -> ok;
- y(T) when is_list(T) =:= true -> ok.
+ y(T) when is_list(T) =:= true -> ok;
+ y(T) when is_record(T, r, 3) -> ok;
+ y(T) when is_record(T, r, 3) =:= true -> ok;
+ y(T) when is_record(T, r) =:= true -> ok.
is_list(_) ->
ok.
+ is_record(_, _) ->
+ ok.
+ is_record(_, _, _) ->
+ ok.
">>,
[{no_auto_import,[{is_tuple,1}]}],
- {errors,[{3,erl_lint,{illegal_guard_local_call,{is_tuple,1}}},
- {4,erl_lint,{illegal_guard_local_call,{is_list,1}}},
- {5,erl_lint,{illegal_guard_local_call,{is_tuple,1}}},
- {6,erl_lint,{illegal_guard_local_call,{is_list,1}}}],[]}}
+ {errors,[{4,erl_lint,{illegal_guard_local_call,{is_tuple,1}}},
+ {5,erl_lint,{illegal_guard_local_call,{is_list,1}}},
+ {6,erl_lint,{illegal_guard_local_call,{is_tuple,1}}},
+ {7,erl_lint,{illegal_guard_local_call,{is_list,1}}},
+ {8,erl_lint,{illegal_guard_local_call,{is_record,3}}},
+ {9,erl_lint,{illegal_guard_local_call,{is_record,3}}}],[]}}
],
?line [] = run(Config, Ts),