diff options
author | Hans Bolinder <[email protected]> | 2018-05-24 12:21:21 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2018-05-25 09:46:47 +0200 |
commit | 324fc38bc442460f871f3ae002dd853415ae9e51 (patch) | |
tree | 26ea1179da346c7954a6064b05460c2eb7cbec0e /lib/dialyzer/src/dialyzer.erl | |
parent | 4f91c8a34f4cc2c728a63e8d218566b3b3795b10 (diff) | |
download | otp-324fc38bc442460f871f3ae002dd853415ae9e51.tar.gz otp-324fc38bc442460f871f3ae002dd853415ae9e51.tar.bz2 otp-324fc38bc442460f871f3ae002dd853415ae9e51.zip |
dialyzer: Refine the test for overspecified functions
The -Woverspecs (-Wspecdiffs) option generates warnings in a few more
cases. The refinement is analogous to the test that -Wunderspecs
already does: it checks if the contract has nothing in common with
some element (see erl_types:t_elements/1) of the success typing.
Diffstat (limited to 'lib/dialyzer/src/dialyzer.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/dialyzer/src/dialyzer.erl b/lib/dialyzer/src/dialyzer.erl index 1538174d4a..185c8c9ae6 100644 --- a/lib/dialyzer/src/dialyzer.erl +++ b/lib/dialyzer/src/dialyzer.erl @@ -409,6 +409,10 @@ message_to_string({extra_range, [M, F, A, ExtraRanges, SigRange]}) -> io_lib:format("The specification for ~w:~tw/~w states that the function" " might also return ~ts but the inferred return is ~ts\n", [M, F, A, ExtraRanges, SigRange]); +message_to_string({missing_range, [M, F, A, ExtraRanges, ContrRange]}) -> + io_lib:format("The success typing for ~w:~tw/~w implies that the function" + " might also return ~ts but the specification return is ~ts\n", + [M, F, A, ExtraRanges, ContrRange]); message_to_string({overlapping_contract, [M, F, A]}) -> io_lib:format("Overloaded contract for ~w:~tw/~w has overlapping domains;" " such contracts are currently unsupported and are simply ignored\n", |