aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-11-15 16:03:18 +0100
committerHans Bolinder <[email protected]>2016-11-22 10:29:04 +0100
commita202c2e0fa1f7810fb19c5a051369ce8b308ebc1 (patch)
tree419bf3fc59eec3dd109d8da50a8f08b50d91c702 /lib/dialyzer/src/dialyzer.erl
parentc79e32a66c366bbdf5025ad0ae7f7057a0ddb156 (diff)
downloadotp-a202c2e0fa1f7810fb19c5a051369ce8b308ebc1.tar.gz
otp-a202c2e0fa1f7810fb19c5a051369ce8b308ebc1.tar.bz2
otp-a202c2e0fa1f7810fb19c5a051369ce8b308ebc1.zip
dialyzer: Improve a warning message
Messages like "Invalid type specification for function para3:exp_adt/0. The success typing is () -> 3" now look like "The specification for para3:exp_adt/0 has an opaque subtype para3_adt:exp1(para3_adt:exp2()) which is violated by the success typing () -> 3". The old message did not give any clue as to what invalidated the contract, namely the opaque subtype.
Diffstat (limited to 'lib/dialyzer/src/dialyzer.erl')
-rw-r--r--lib/dialyzer/src/dialyzer.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/dialyzer/src/dialyzer.erl b/lib/dialyzer/src/dialyzer.erl
index 7f86520c06..aaa2f358d6 100644
--- a/lib/dialyzer/src/dialyzer.erl
+++ b/lib/dialyzer/src/dialyzer.erl
@@ -407,6 +407,10 @@ message_to_string({contract_range, [Contract, M, F, ArgStrings, Line, CRet]}) ->
message_to_string({invalid_contract, [M, F, A, Sig]}) ->
io_lib:format("Invalid type specification for function ~w:~w/~w."
" The success typing is ~s\n", [M, F, A, Sig]);
+message_to_string({contract_with_opaque, [M, F, A, OpaqueType, SigType]}) ->
+ io_lib:format("The specification for ~w:~w/~w"
+ " has an opaque subtype ~s which is violated by the"
+ " success typing ~s\n", [M, F, A, OpaqueType, SigType]);
message_to_string({extra_range, [M, F, A, ExtraRanges, SigRange]}) ->
io_lib:format("The specification for ~w:~w/~w states that the function"
" might also return ~s but the inferred return is ~s\n",