aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/erl_lint.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-04-30 09:11:34 +0200
committerHans Bolinder <[email protected]>2015-01-14 16:21:09 +0100
commit25ab719cfaf42d196287fec2171bf3eefb845b62 (patch)
treedc5771a1b23606a1a507ae1876199d7ce23a60b8 /lib/stdlib/src/erl_lint.erl
parent9c544a43348b920896ff2062db2caa128f08af83 (diff)
downloadotp-25ab719cfaf42d196287fec2171bf3eefb845b62.tar.gz
otp-25ab719cfaf42d196287fec2171bf3eefb845b62.tar.bz2
otp-25ab719cfaf42d196287fec2171bf3eefb845b62.zip
dialyzer: Introduce module local suppression of warnings
The -dialyzer() attribute can be used for suppressing warnings in a module by specifying functions or warning options. It can also be used for requesting warnings in a module.
Diffstat (limited to 'lib/stdlib/src/erl_lint.erl')
-rw-r--r--lib/stdlib/src/erl_lint.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index 26d8454731..b870ccf1f9 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -744,6 +744,8 @@ attribute_state(Form, St) ->
%% State'
%% Allow for record, type and opaque type definitions and spec
%% declarations to be intersperced within function definitions.
+%% Dialyzer attributes are also allowed everywhere, but are not
+%% checked at all.
function_state({attribute,L,record,{Name,Fields}}, St) ->
record_def(L, Name, Fields, St);
@@ -753,6 +755,8 @@ function_state({attribute,L,opaque,{TypeName,TypeDef,Args}}, St) ->
type_def(opaque, L, TypeName, TypeDef, Args, St);
function_state({attribute,L,spec,{Fun,Types}}, St) ->
spec_decl(L, Fun, Types, St);
+function_state({attribute,_L,dialyzer,_Val}, St) ->
+ St;
function_state({attribute,La,Attr,_Val}, St) ->
add_error(La, {attribute,Attr}, St);
function_state({function,L,N,A,Cs}, St) ->