diff options
author | Björn Gustavsson <[email protected]> | 2012-08-13 10:09:48 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-08-15 10:54:52 +0200 |
commit | 6cdc6b667a8db2b63a4613c63dc4f75a34a5ea7f (patch) | |
tree | 506c68241e387fe5b569f5a1fcad85e416fee317 /lib/stdlib/test/erl_lint_SUITE.erl | |
parent | ee5fdd50040894b27fd3fe9e767eab3821666e9a (diff) | |
download | otp-6cdc6b667a8db2b63a4613c63dc4f75a34a5ea7f.tar.gz otp-6cdc6b667a8db2b63a4613c63dc4f75a34a5ea7f.tar.bz2 otp-6cdc6b667a8db2b63a4613c63dc4f75a34a5ea7f.zip |
erl_lint: Add a deprecated warning for literal tuple funs
The run-time warning for use of tuple funs will not catch the use
of literal tuple funs, such as:
if
{erlang,'+'}(3,X) =:= 0 -> true;
true -> false
end.
Therefore, add a compile-time warning to give users some warning
before they stop working in R16.
Diffstat (limited to 'lib/stdlib/test/erl_lint_SUITE.erl')
-rw-r--r-- | lib/stdlib/test/erl_lint_SUITE.erl | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl index dcd622b984..9f9d97b619 100644 --- a/lib/stdlib/test/erl_lint_SUITE.erl +++ b/lib/stdlib/test/erl_lint_SUITE.erl @@ -1331,17 +1331,20 @@ guard(Config) when is_list(Config) -> foo. ">>, [warn_unused_vars, nowarn_obsolete_guard], - {errors,[{2,erl_lint,illegal_guard_expr}, - {4,erl_lint,illegal_guard_expr}, - {6,erl_lint,illegal_guard_expr}, - {8,erl_lint,illegal_guard_expr}, - {10,erl_lint,illegal_guard_expr}, - {12,erl_lint,illegal_guard_expr}, - {14,erl_lint,illegal_guard_expr}, - {16,erl_lint,illegal_guard_expr}, - {18,erl_lint,illegal_guard_expr}, - {20,erl_lint,illegal_guard_expr}], - []}}, + {error,[{2,erl_lint,illegal_guard_expr}, + {4,erl_lint,illegal_guard_expr}, + {6,erl_lint,illegal_guard_expr}, + {8,erl_lint,illegal_guard_expr}, + {10,erl_lint,illegal_guard_expr}, + {12,erl_lint,illegal_guard_expr}, + {14,erl_lint,illegal_guard_expr}, + {16,erl_lint,illegal_guard_expr}, + {18,erl_lint,illegal_guard_expr}, + {20,erl_lint,illegal_guard_expr}], + [{8,erl_lint,deprecated_tuple_fun}, + {14,erl_lint,deprecated_tuple_fun}, + {20,erl_lint,deprecated_tuple_fun}, + {28,erl_lint,deprecated_tuple_fun}]}}, {guard6, <<"-record(apa,{a=a,b=foo:bar()}). apa() -> |