diff options
author | Stavros Aronis <[email protected]> | 2011-07-16 13:51:39 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-08-01 16:06:16 +0200 |
commit | 5a68d017d583f4d9f046d6581fb9f9c2337403c6 (patch) | |
tree | f8c266be0e77f211966c3168011b576fe5661db7 /lib | |
parent | a50b0c626f5f92ba0e11b8de8115bacf33189867 (diff) | |
download | otp-5a68d017d583f4d9f046d6581fb9f9c2337403c6.tar.gz otp-5a68d017d583f4d9f046d6581fb9f9c2337403c6.tar.bz2 otp-5a68d017d583f4d9f046d6581fb9f9c2337403c6.zip |
Fix bug when reporting unused functions
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dialyzer/src/dialyzer_dataflow.erl | 2 | ||||
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/nowarnunused.erl | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl index 7137dbc036..121667b5a5 100644 --- a/lib/dialyzer/src/dialyzer_dataflow.erl +++ b/lib/dialyzer/src/dialyzer_dataflow.erl @@ -2915,7 +2915,7 @@ state__get_warnings(#state{tree_map = TreeMap, fun_tab = FunTab, {Warn, Msg} = case dialyzer_callgraph:lookup_name(FunLbl, Callgraph) of error -> {true, {unused_fun, []}}; - {ok, {_M, F, A}} = MFA -> + {ok, {_M, F, A} = MFA} -> {not sets:is_element(MFA, NoWarnUnused), {unused_fun, [F, A]}} end, diff --git a/lib/dialyzer/test/small_SUITE_data/src/nowarnunused.erl b/lib/dialyzer/test/small_SUITE_data/src/nowarnunused.erl new file mode 100644 index 0000000000..63daeee9e3 --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/nowarnunused.erl @@ -0,0 +1,7 @@ +-module(nowarnunused). + +-compile({nowarn_unused_function, return_error/2}). + +-spec return_error(integer(), any()) -> no_return(). +return_error(Line, Message) -> + throw({error, {Line, ?MODULE, Message}}). |