aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-03-20 16:08:34 +0100
committerHans Bolinder <[email protected]>2014-03-20 16:08:34 +0100
commita50d7e892e3b2b3c8241eabd6bd0121672a6720f (patch)
treefa2b740128eb544fdcb7afcdac81a7f10c8ab215 /lib/dialyzer/src/dialyzer.erl
parent164b0bb8b6ad3f065b520996296253b5dbe25f6b (diff)
parentad8bf9b974ed80bf4efcb4c2be606b482c6293a1 (diff)
downloadotp-a50d7e892e3b2b3c8241eabd6bd0121672a6720f.tar.gz
otp-a50d7e892e3b2b3c8241eabd6bd0121672a6720f.tar.bz2
otp-a50d7e892e3b2b3c8241eabd6bd0121672a6720f.zip
Merge branch 'hb/dialyzer/unknown_warnings'
* hb/dialyzer/unknown_warnings: Introduce a new warning option, 'no_unknown' Return warnings for unknown types and functions in Erlang Mode
Diffstat (limited to 'lib/dialyzer/src/dialyzer.erl')
-rw-r--r--lib/dialyzer/src/dialyzer.erl13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/dialyzer/src/dialyzer.erl b/lib/dialyzer/src/dialyzer.erl
index bb7e39dfda..1b7b0226cc 100644
--- a/lib/dialyzer/src/dialyzer.erl
+++ b/lib/dialyzer/src/dialyzer.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -172,7 +172,7 @@ run(Opts) ->
end,
case dialyzer_cl:start(OptsRecord) of
{?RET_DISCREPANCIES, Warnings} -> Warnings;
- {?RET_NOTHING_SUSPICIOUS, []} -> []
+ {?RET_NOTHING_SUSPICIOUS, _} -> []
end
catch
throw:{dialyzer_error, ErrorMsg} ->
@@ -474,7 +474,14 @@ message_to_string({callback_missing, [B, F, A]}) ->
io_lib:format("Undefined callback function ~w/~w (behaviour '~w')\n",
[F, A, B]);
message_to_string({callback_info_missing, [B]}) ->
- io_lib:format("Callback info about the ~w behaviour is not available\n", [B]).
+ io_lib:format("Callback info about the ~w behaviour is not available\n", [B]);
+%%----- Warnings for unknown functions, types, and behaviours -------------
+message_to_string({unknown_type, {M, F, A}}) ->
+ io_lib:format("Unknown type ~w:~w/~w", [M, F, A]);
+message_to_string({unknown_function, {M, F, A}}) ->
+ io_lib:format("Unknown function ~w:~w/~w", [M, F, A]);
+message_to_string({unknown_behaviour, B}) ->
+ io_lib:format("Unknown behaviour ~w", [B]).
%%-----------------------------------------------------------------------------
%% Auxiliary functions below