From 5a9cc02690d033a2f3e695d7ac42c2756dbaaf04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20L=C3=A5ng?= Date: Wed, 7 Sep 2016 16:45:21 +0200 Subject: 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. --- lib/dialyzer/test/map_SUITE_data/src/opaque_bif.erl | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lib/dialyzer/test/map_SUITE_data/src/opaque_bif.erl (limited to 'lib/dialyzer/test/map_SUITE_data/src') 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() -> #{}. -- cgit v1.2.3