diff options
author | Stavros Aronis <[email protected]> | 2011-11-14 17:01:59 +0100 |
---|---|---|
committer | Stavros Aronis <[email protected]> | 2011-11-18 15:06:46 +0100 |
commit | 8167578ca6b23f3043ae2e21ded4b13b8db74e20 (patch) | |
tree | b0dea28568f073b63034cff0d3621f56e20795c7 /lib/dialyzer/src/dialyzer.erl | |
parent | 8682e6b3db55f7f021e529b2134f223b4cc70ace (diff) | |
download | otp-8167578ca6b23f3043ae2e21ded4b13b8db74e20.tar.gz otp-8167578ca6b23f3043ae2e21ded4b13b8db74e20.tar.bz2 otp-8167578ca6b23f3043ae2e21ded4b13b8db74e20.zip |
Wrap up behaviours patch for Dialyzer
Enable warnings by default, add two options for suppressing them,
fix warning formatting and update testsuites.
Diffstat (limited to 'lib/dialyzer/src/dialyzer.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer.erl | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/dialyzer/src/dialyzer.erl b/lib/dialyzer/src/dialyzer.erl index 487a12b252..3e3c12405f 100644 --- a/lib/dialyzer/src/dialyzer.erl +++ b/lib/dialyzer/src/dialyzer.erl @@ -442,18 +442,24 @@ message_to_string({opaque_type_test, [Fun, Opaque]}) -> message_to_string({race_condition, [M, F, Args, Reason]}) -> io_lib:format("The call ~w:~w~s ~s\n", [M, F, Args, Reason]); %%----- Warnings for behaviour errors -------------------- -message_to_string({callback_type_mismatch, [B, F, A, T]}) -> - io_lib:format("The inferred return type for ~w/~w is ~s which is not valid" - " return for the callback of the ~w behaviour\n", - [F, A, T, B]); -message_to_string({callback_arg_type_mismatch, [B, F, A, N, T]}) -> - io_lib:format("The inferred type for the ~s argument of ~w/~w is ~s which is" - " not valid for the callback of the ~w behaviour" - "\n", [ordinal(N), F, A, T, B]); +message_to_string({callback_type_mismatch, [B, F, A, ST, CT]}) -> + io_lib:format("The inferred return type of ~w/~w (~s) has nothing in common" + " with ~s, which is the expected return type for the callback of" + " ~w behaviour\n", [F, A, ST, CT, B]); +message_to_string({callback_arg_type_mismatch, [B, F, A, N, ST, CT]}) -> + io_lib:format("The inferred type for the ~s argument of ~w/~w (~s) is" + " not a supertype of ~s, which is expected type for this" + " argument in the callback of the ~w behaviour\n", + [ordinal(N), F, A, ST, CT, B]); message_to_string({callback_spec_type_mismatch, [B, F, A, ST, CT]}) -> io_lib:format("The return type ~s in the specification of ~w/~w is not a" " subtype of ~s, which is the expected return type for the" - " callback of ~w behaviour.\n", [ST, F, A, CT, B]); + " callback of ~w behaviour\n", [ST, F, A, CT, B]); +message_to_string({callback_spec_arg_type_mismatch, [B, F, A, N, ST, CT]}) -> + io_lib:format("The specified type for the ~s argument of ~w/~w (~s) is" + " not a supertype of ~s, which is expected type for this" + " argument in the callback of the ~w behaviour\n", + [ordinal(N), F, A, ST, CT, B]); message_to_string({callback_missing, [B, F, A]}) -> io_lib:format("Undefined callback function ~w/~w (behaviour '~w')\n", [F, A, B]); |