From 6d9d4af8725f26972481b2e997c54ee5b3eafb29 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 24 Apr 2019 09:52:54 +0200 Subject: dialyzer: Improve the warning tagged 'fun_app_args' The mismatching argument positions are included. --- lib/dialyzer/test/small_SUITE_data/results/fun_app_args | 3 +++ lib/dialyzer/test/small_SUITE_data/src/fun_app_args.erl | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 lib/dialyzer/test/small_SUITE_data/results/fun_app_args create mode 100644 lib/dialyzer/test/small_SUITE_data/src/fun_app_args.erl (limited to 'lib/dialyzer/test/small_SUITE_data') diff --git a/lib/dialyzer/test/small_SUITE_data/results/fun_app_args b/lib/dialyzer/test/small_SUITE_data/results/fun_app_args new file mode 100644 index 0000000000..ac153a6fb2 --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/results/fun_app_args @@ -0,0 +1,3 @@ + +fun_app_args.erl:12: Fun application with arguments ('b',[]) will fail since the function has type 'c' | fun(('a',[]) -> any()), which differs in the 1st argument +fun_app_args.erl:12: The created fun has no local return diff --git a/lib/dialyzer/test/small_SUITE_data/src/fun_app_args.erl b/lib/dialyzer/test/small_SUITE_data/src/fun_app_args.erl new file mode 100644 index 0000000000..b4409bc550 --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/fun_app_args.erl @@ -0,0 +1,12 @@ +-module(fun_app_args). + +-export([t/1]). + +-type ft() :: fun((a, []) -> any()). + +-record(r, { + h = c :: c | ft() +}). + +t(#r{h = H}) -> + fun(_) -> (H)(b, []) end. -- cgit v1.2.3