aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer.erl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2019-04-24 09:52:54 +0200
committerHans Bolinder <[email protected]>2019-04-24 15:23:29 +0200
commit6d9d4af8725f26972481b2e997c54ee5b3eafb29 (patch)
tree57942b9705ea269315df5bcd6ef1555ba7051bae /lib/dialyzer/src/dialyzer.erl
parent5b56ecbe12493a1ff6a0e975a65cefd09005cecd (diff)
downloadotp-6d9d4af8725f26972481b2e997c54ee5b3eafb29.tar.gz
otp-6d9d4af8725f26972481b2e997c54ee5b3eafb29.tar.bz2
otp-6d9d4af8725f26972481b2e997c54ee5b3eafb29.zip
dialyzer: Improve the warning tagged 'fun_app_args'
The mismatching argument positions are included.
Diffstat (limited to 'lib/dialyzer/src/dialyzer.erl')
-rw-r--r--lib/dialyzer/src/dialyzer.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/dialyzer/src/dialyzer.erl b/lib/dialyzer/src/dialyzer.erl
index 185c8c9ae6..a168b3c8c5 100644
--- a/lib/dialyzer/src/dialyzer.erl
+++ b/lib/dialyzer/src/dialyzer.erl
@@ -320,9 +320,12 @@ message_to_string({call_to_missing, [M, F, A]}) ->
message_to_string({exact_eq, [Type1, Op, Type2]}) ->
io_lib:format("The test ~ts ~s ~ts can never evaluate to 'true'\n",
[Type1, Op, Type2]);
-message_to_string({fun_app_args, [Args, Type]}) ->
+message_to_string({fun_app_args, [ArgNs, Args, Type]}) ->
+ PositionString = form_position_string(ArgNs),
io_lib:format("Fun application with arguments ~ts will fail"
- " since the function has type ~ts\n", [Args, Type]);
+ " since the function has type ~ts,"
+ " which differs in the ~s argument\n",
+ [Args, Type, PositionString]);
message_to_string({fun_app_no_fun, [Op, Type, Arity]}) ->
io_lib:format("Fun application will fail since ~ts :: ~ts"
" is not a function of arity ~w\n", [Op, Type, Arity]);