aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/map_SUITE_data/src/exact.erl
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-02-28 00:00:33 +0100
committerHans Bolinder <[email protected]>2016-04-28 16:16:09 +0200
commite3ac51b173585f84c397ae38c27d772be2d308c6 (patch)
tree209839880b65086d3be7e5db1c42fe1fe5f85708 /lib/dialyzer/test/map_SUITE_data/src/exact.erl
parent92a672ff8159741ebbc9f3eb11e8a81d7067d2c7 (diff)
downloadotp-e3ac51b173585f84c397ae38c27d772be2d308c6.tar.gz
otp-e3ac51b173585f84c397ae38c27d772be2d308c6.tar.bz2
otp-e3ac51b173585f84c397ae38c27d772be2d308c6.zip
dialyzer_dataflow: Add map support
Diffstat (limited to 'lib/dialyzer/test/map_SUITE_data/src/exact.erl')
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/exact.erl23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/dialyzer/test/map_SUITE_data/src/exact.erl b/lib/dialyzer/test/map_SUITE_data/src/exact.erl
new file mode 100644
index 0000000000..e5ad02ec54
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/exact.erl
@@ -0,0 +1,23 @@
+-module(exact).
+
+-export([t1/1, t2/1]).
+
+t1(M = #{}) ->
+ any_map(M),
+ case M of
+ #{a := _} -> error(fail);
+ _ -> ok
+ end.
+
+any_map(X) ->
+ X#{a => 1, a := 2}.
+
+t2(M = #{}) ->
+ has_a(M),
+ case M of
+ #{a := _} -> error(ok);
+ _ -> unreachable
+ end.
+
+has_a(M) ->
+ M#{a := 1, a => 2}.