diff options
author | Björn Gustavsson <[email protected]> | 2012-01-18 15:07:13 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-01-18 15:07:13 +0100 |
commit | 878194c3b0ccb5d606ad5c9992dd703b97e38321 (patch) | |
tree | 7543e0e944106972351f4fe227d8e26d5826aae3 /lib/stdlib/test | |
parent | 57ff4117e17dd31202acd99bff87570405cd66f4 (diff) | |
parent | 11d255627033bb96e7c737d35badbacae32a8631 (diff) | |
download | otp-878194c3b0ccb5d606ad5c9992dd703b97e38321.tar.gz otp-878194c3b0ccb5d606ad5c9992dd703b97e38321.tar.bz2 otp-878194c3b0ccb5d606ad5c9992dd703b97e38321.zip |
Merge branch 'maint'
* maint:
Update primary bootstrap
erl_lint: Consistently reject local calls from guards
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r-- | lib/stdlib/test/erl_lint_SUITE.erl | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index 9041adbe5c..e4c7fd5b02 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -2631,7 +2631,24 @@ bif_clash(Config) when is_list(Config) -> binary_part(A,B,C). ">>, [warn_unused_import], - {warnings,[{2,erl_lint,{redefine_bif_import,{binary_part,3}}}]}} + {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. + {clash21, + <<"-export([is_list/1]). + -import(x, [is_tuple/1]). + 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. + is_list(_) -> + 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}}}],[]}} ], ?line [] = run(Config, Ts), |