From 985f5a1fae38caed84cde8bc09f6f60e91710f20 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Wed, 15 Nov 2017 12:57:57 +0100 Subject: dialyzer: Extend the map implementation's handling of ?unit The Maps implementation handles ?unit in more cases. Exactly when t_is_none_or_unit() is to be called is not clear to me. The added cases are about a map type being ?unit, but the key or the value of an association can also be ?unit, but that is not always checked. --- lib/dialyzer/test/map_SUITE_data/results/map_anon_fun | 2 ++ lib/dialyzer/test/map_SUITE_data/src/map_anon_fun.erl | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 lib/dialyzer/test/map_SUITE_data/results/map_anon_fun create mode 100644 lib/dialyzer/test/map_SUITE_data/src/map_anon_fun.erl (limited to 'lib/dialyzer/test') diff --git a/lib/dialyzer/test/map_SUITE_data/results/map_anon_fun b/lib/dialyzer/test/map_SUITE_data/results/map_anon_fun new file mode 100644 index 0000000000..cfca5b1407 --- /dev/null +++ b/lib/dialyzer/test/map_SUITE_data/results/map_anon_fun @@ -0,0 +1,2 @@ + +map_anon_fun.erl:4: Function g/1 will never be called diff --git a/lib/dialyzer/test/map_SUITE_data/src/map_anon_fun.erl b/lib/dialyzer/test/map_SUITE_data/src/map_anon_fun.erl new file mode 100644 index 0000000000..e77016d68a --- /dev/null +++ b/lib/dialyzer/test/map_SUITE_data/src/map_anon_fun.erl @@ -0,0 +1,9 @@ +-module(map_anon_fun). + +%% Not exported. +g(A) -> + maps:map(fun F(K, {V, _C}) -> + F(K, V); + F(_K, _V) -> + #{ system => {A} } + end, #{}). -- cgit v1.2.3