aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/small_SUITE_data/src
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-12-01 16:40:13 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-12-01 16:41:13 +0100
commit6f7dd46137f9651b2f1b1b6f9803cd2434cb87eb (patch)
tree39804965047f11fb9cd03c1c2f3bcb736cd32828 /lib/dialyzer/test/small_SUITE_data/src
parent56f9f62b59eda9dcc36bd47efef68b0243e0cfd1 (diff)
downloadotp-6f7dd46137f9651b2f1b1b6f9803cd2434cb87eb.tar.gz
otp-6f7dd46137f9651b2f1b1b6f9803cd2434cb87eb.tar.bz2
otp-6f7dd46137f9651b2f1b1b6f9803cd2434cb87eb.zip
dialyzer: Test recoalesced map keys
Diffstat (limited to 'lib/dialyzer/test/small_SUITE_data/src')
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/maps1.erl36
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/maps1.erl b/lib/dialyzer/test/small_SUITE_data/src/maps1.erl
index 06ced5b69e..228ffe2c22 100644
--- a/lib/dialyzer/test/small_SUITE_data/src/maps1.erl
+++ b/lib/dialyzer/test/small_SUITE_data/src/maps1.erl
@@ -10,6 +10,7 @@
-export([recv/3, decode/1]).
+-export([get_my_map/0,is_my_map/1]).
%-record(can_pkt, {id, data :: binary(), timestamp}).
@@ -39,3 +40,38 @@ t2() -> ok.
update(#{ id := Id, val := Val } = M, X) when is_integer(Id) ->
M#{ val := [Val,X] }.
+
+%% key coalescing
+
+-spec get_my_map() -> map().
+
+get_my_map() ->
+ #{labels => [one, two],
+ number => 27,
+ [1,2,3] => wer,
+ {4,5,6} => sdf,
+ kvok => #{
+ <<"wat">> => v,
+ a => qwe,
+ 2 => asd,
+ [1,2,3] => wer,
+ {4,5,6} => sdf,
+ "abc" => zxc
+ }
+ }.
+
+-spec is_my_map(map()) -> 'ok'.
+
+is_my_map(#{labels := [one, two],
+ number := 27,
+ [1,2,3] := wer,
+ {4,5,6} := sdf,
+ kvok := #{
+ <<"wat">> := v,
+ a := qwe,
+ 2 := asd,
+ [1,2,3] := wer,
+ {4,5,6} := sdf,
+ "abc" := zxc
+ }
+ }) -> ok.