aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/map_SUITE_data
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-09-07 16:45:21 +0200
committerMagnus Lång <[email protected]>2016-09-07 16:45:21 +0200
commit5a9cc02690d033a2f3e695d7ac42c2756dbaaf04 (patch)
treea90f0eb983d11a4bf99f8e6db5be350afd5e33a5 /lib/dialyzer/test/map_SUITE_data
parent71894a879d6254693791585246ce340dd7414b82 (diff)
downloadotp-5a9cc02690d033a2f3e695d7ac42c2756dbaaf04.tar.gz
otp-5a9cc02690d033a2f3e695d7ac42c2756dbaaf04.tar.bz2
otp-5a9cc02690d033a2f3e695d7ac42c2756dbaaf04.zip
erl_bif_types: Properly unopaque maps:merge/2 args
erl_bif_types:type/5 was calling erl_types:map_pairwise_merge/3 directly with its (potentially opaque) arguments, causing Dialyzer crashes. Bug (ERL-249) reported and minimised test case provided by Felipe Ripoll.
Diffstat (limited to 'lib/dialyzer/test/map_SUITE_data')
-rw-r--r--lib/dialyzer/test/map_SUITE_data/src/opaque_bif.erl13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/dialyzer/test/map_SUITE_data/src/opaque_bif.erl b/lib/dialyzer/test/map_SUITE_data/src/opaque_bif.erl
new file mode 100644
index 0000000000..40214a1887
--- /dev/null
+++ b/lib/dialyzer/test/map_SUITE_data/src/opaque_bif.erl
@@ -0,0 +1,13 @@
+-module(opaque_bif).
+-export([o1/1]).
+-export_type([opaque_any_map/0]).
+-opaque opaque_any_map() :: map().
+
+%% ERL-249: A bug with opaque arguments to maps:merge/2
+%% Reported by Felipe Ripoll on 6/9/2016
+-spec o1(opaque_any_map()) -> opaque_any_map().
+o1(Map) ->
+ maps:merge(o1_c(), Map).
+
+-spec o1_c() -> opaque_any_map().
+o1_c() -> #{}.