aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2014-03-01 16:38:01 +0100
committerAnthony Ramine <[email protected]>2014-03-01 17:02:47 +0100
commit66057b0e0c6e4a69b878090543604a7c2a59b34c (patch)
treeba69bf5c675c981e26c03f340580962e1f203bd0 /lib/stdlib/test
parentdb911c1f15372d2dadf06e8502506b0936a4fbb3 (diff)
downloadotp-66057b0e0c6e4a69b878090543604a7c2a59b34c.tar.gz
otp-66057b0e0c6e4a69b878090543604a7c2a59b34c.tar.bz2
otp-66057b0e0c6e4a69b878090543604a7c2a59b34c.zip
Properly lint shortcircuiting operators
Shortcircuiting operators are not real functions and can't be used as such with erlang:'andalso'(...) and erlang:'orelse'(...). Reported-by: Ulf Norell
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/erl_lint_SUITE.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index 48f50d5f43..3143022572 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -1493,7 +1493,15 @@ guard(Config) when is_list(Config) ->
[],
{errors,[{1,erl_lint,illegal_guard_expr},
{2,erl_lint,illegal_guard_expr},
- {3,erl_lint,illegal_guard_expr}],[]}}
+ {3,erl_lint,illegal_guard_expr}],[]}},
+ {guard9,
+ <<"t(X, Y) when erlang:'andalso'(X, Y) -> ok;
+ t(X, Y) when erlang:'orelse'(X, Y) -> ok.
+ ">>,
+ [],
+ {errors,[{1,erl_lint,illegal_guard_expr},
+ {2,erl_lint,illegal_guard_expr}],
+ []}}
],
?line [] = run(Config, Ts1),
ok.