aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/map_SUITE_data/src/typeflow.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-02-27 23:29:43 +0100
committerHans Bolinder <[email protected]>2016-04-28 16:16:09 +0200
commit92a672ff8159741ebbc9f3eb11e8a81d7067d2c7 (patch)
tree24268f010ffdc6def5cb658df4698471832e26f6 /lib/dialyzer/test/map_SUITE_data/src/typeflow.erl
parenta13d4a750dfdf9a2a96d1e7ec0054644187afa59 (diff)
downloadotp-92a672ff8159741ebbc9f3eb11e8a81d7067d2c7.tar.gz
otp-92a672ff8159741ebbc9f3eb11e8a81d7067d2c7.tar.bz2
otp-92a672ff8159741ebbc9f3eb11e8a81d7067d2c7.zip
dialyzer_typesig: Add map support
Diffstat (limited to 'lib/dialyzer/test/map_SUITE_data/src/typeflow.erl')
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/typeflow.erl25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/dialyzer/test/map_SUITE_data/src/typeflow.erl b/lib/dialyzer/test/map_SUITE_data/src/typeflow.erl
new file mode 100644
index 0000000000..b43fd6897b
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/typeflow.erl
@@ -0,0 +1,25 @@
+-module(typeflow).
+
+-export([t1/1, t2/1, t3/1, t4/1]).
+
+t1(M = #{}) ->
+ a_is_integer(M),
+ case M of
+ #{a := X} when is_integer(X) -> ok;
+ _ -> fail
+ end.
+
+a_is_integer(#{a := X}) when is_integer(X) -> ok.
+
+t2(M = #{}) ->
+ a_is_integer(M),
+ lists:sort(maps:get(a, M)),
+ ok.
+
+t3(M = #{}) ->
+ lists:sort(maps:get(a, M)),
+ ok.
+
+t4(M) ->
+ lists:sort(maps:get(a, M)),
+ ok.