diff options
author | Björn-Egil Dahlberg <[email protected]> | 2014-12-02 14:14:51 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2014-12-02 14:14:51 +0100 |
commit | a48e4e2d7775ad34f980a1f17e270e5d9232add3 (patch) | |
tree | 5717b2ef8a27566889f41162f91448c231405f00 /lib/dialyzer | |
parent | 6740f93fac65a2e2b8079a6f1a6b74ae847766d9 (diff) | |
parent | 6f7dd46137f9651b2f1b1b6f9803cd2434cb87eb (diff) | |
download | otp-a48e4e2d7775ad34f980a1f17e270e5d9232add3.tar.gz otp-a48e4e2d7775ad34f980a1f17e270e5d9232add3.tar.bz2 otp-a48e4e2d7775ad34f980a1f17e270e5d9232add3.zip |
Merge branch 'egil/fix-dialyzer-map-key-coalescing/OTP-12347' into maint
* egil/fix-dialyzer-map-key-coalescing/OTP-12347:
dialyzer: Test recoalesced map keys
compiler: Coalesce map keys in dialyzer mode
Diffstat (limited to 'lib/dialyzer')
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/maps1.erl | 36 |
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. |