aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-11-15 12:57:57 +0100
committerHans Bolinder <[email protected]>2017-11-22 15:07:46 +0100
commit985f5a1fae38caed84cde8bc09f6f60e91710f20 (patch)
treee0e07734f8f83fe4475e39645cd0aa17b592cbe3 /lib/dialyzer/test
parentcf349b8dc02123c97ad8027594b9792d846fd6a2 (diff)
downloadotp-985f5a1fae38caed84cde8bc09f6f60e91710f20.tar.gz
otp-985f5a1fae38caed84cde8bc09f6f60e91710f20.tar.bz2
otp-985f5a1fae38caed84cde8bc09f6f60e91710f20.zip
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.
Diffstat (limited to 'lib/dialyzer/test')
-rw-r--r--lib/dialyzer/test/map_SUITE_data/results/map_anon_fun2
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/map_anon_fun.erl9
2 files changed, 11 insertions, 0 deletions
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, #{}).