diff options
author | Hans Bolinder <[email protected]> | 2017-11-15 12:57:57 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2017-11-22 15:07:46 +0100 |
commit | 985f5a1fae38caed84cde8bc09f6f60e91710f20 (patch) | |
tree | e0e07734f8f83fe4475e39645cd0aa17b592cbe3 /lib/dialyzer/test | |
parent | cf349b8dc02123c97ad8027594b9792d846fd6a2 (diff) | |
download | otp-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_fun | 2 | ||||
-rw-r--r-- | lib/dialyzer/test/map_SUITE_data/src/map_anon_fun.erl | 9 |
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, #{}). |