aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-01-14 14:44:06 +0100
committerBjörn-Egil Dahlberg <[email protected]>2016-01-14 14:48:59 +0100
commitfea8e2cade3de24f044c834e0b62f58921a4e9c1 (patch)
tree599726f84ba377c1d0440331855a68bd6085811b /lib/dialyzer
parent5a874a9e58e09a894f36ab81a0eef46e1fc27cd0 (diff)
downloadotp-fea8e2cade3de24f044c834e0b62f58921a4e9c1.tar.gz
otp-fea8e2cade3de24f044c834e0b62f58921a4e9c1.tar.bz2
otp-fea8e2cade3de24f044c834e0b62f58921a4e9c1.zip
dialyzer: Update Maps tests
Diffstat (limited to 'lib/dialyzer')
-rw-r--r--lib/dialyzer/test/small_SUITE_data/results/maps14
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/maps1.erl12
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.