diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-01-18 10:08:54 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-01-18 10:08:54 +0100 |
commit | 427c9f4f7777dd00e0a03a42b9834a4d669305b6 (patch) | |
tree | 040b2da3d1174bbcacb7e4dc518f91d568d36b77 /lib/dialyzer | |
parent | 3d1716e8f4c5fafbddc4e50bc93456398e9cc209 (diff) | |
parent | 48e25dfef23a51d02629b2c9fa9963fd3ba7788c (diff) | |
download | otp-427c9f4f7777dd00e0a03a42b9834a4d669305b6.tar.gz otp-427c9f4f7777dd00e0a03a42b9834a4d669305b6.tar.bz2 otp-427c9f4f7777dd00e0a03a42b9834a4d669305b6.zip |
Merge branch 'egil/improve-map-cerl-prettypr/OTP-13238' into maint
* egil/improve-map-cerl-prettypr/OTP-13238:
compiler, hipe: Fix pretty printing of Core Maps
hipe: Fix map pretty printing of pairs
dialyzer: Update Maps tests
Diffstat (limited to 'lib/dialyzer')
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/results/maps1 | 4 | ||||
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/maps1.erl | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/results/maps1 b/lib/dialyzer/test/small_SUITE_data/results/maps1 new file mode 100644 index 0000000000..5a78d66a92 --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/results/maps1 @@ -0,0 +1,4 @@ + +maps1.erl:43: Function t3/0 has no local return +maps1.erl:44: The call maps1:foo(~{'greger'=>3, ~{'arne'=>'anka'}~=>45}~,1) will never return since it differs in the 2nd argument from the success typing arguments: (#{},'b') +maps1.erl:52: The call Mod:'function'(~{'literal'=>'map'}~,'another_arg') requires that Mod is of type atom() | tuple() not #{} diff --git a/lib/dialyzer/test/small_SUITE_data/src/maps1.erl b/lib/dialyzer/test/small_SUITE_data/src/maps1.erl index 06ced5b69e..bb2f66a498 100644 --- a/lib/dialyzer/test/small_SUITE_data/src/maps1.erl +++ b/lib/dialyzer/test/small_SUITE_data/src/maps1.erl @@ -39,3 +39,15 @@ t2() -> ok. update(#{ id := Id, val := Val } = M, X) when is_integer(Id) -> M#{ val := [Val,X] }. + +t3() -> + foo(#{greger => 3, #{arne=>anka} => 45}, 1). + +foo(#{} = M, b) -> %% Error + M#{alfa => 42, beta := 1337}. + +t4() -> + case #{} of + #{} -> ok; + Mod -> Mod:function(#{literal => map}, another_arg) %% Error + end. |