From d2ba8674603bc4ef210ec91e6f51924f7efe8c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20L=C3=A5ng?= Date: Mon, 18 Apr 2016 19:19:23 +0200 Subject: erl_types: Fix crash merging maps with opaque keys Opaque keys in maps broke an assumption in erl_types:mapmerge_otherv/3 (that the infinimum of a singleton type and some other type would either be none() or that same singleton type), causing a case_clause crash. --- lib/dialyzer/test/map_SUITE_data/results/opaque_key | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lib/dialyzer/test/map_SUITE_data/results/opaque_key (limited to 'lib/dialyzer/test/map_SUITE_data/results') diff --git a/lib/dialyzer/test/map_SUITE_data/results/opaque_key b/lib/dialyzer/test/map_SUITE_data/results/opaque_key new file mode 100644 index 0000000000..df8c825b18 --- /dev/null +++ b/lib/dialyzer/test/map_SUITE_data/results/opaque_key @@ -0,0 +1,21 @@ + +opaque_key_adt.erl:32: Invalid type specification for function opaque_key_adt:s1/0. The success typing is () -> #{3:='a'} +opaque_key_adt.erl:35: Invalid type specification for function opaque_key_adt:s2/0. The success typing is () -> #{3:='a'} +opaque_key_adt.erl:41: Invalid type specification for function opaque_key_adt:s4/0. The success typing is () -> #{1:='a'} +opaque_key_adt.erl:53: Invalid type specification for function opaque_key_adt:sm1/0. The success typing is () -> #{1:=2, 3:='a'} +opaque_key_adt.erl:56: Invalid type specification for function opaque_key_adt:smt1/0. The success typing is () -> #{3:='a'} +opaque_key_adt.erl:59: Invalid type specification for function opaque_key_adt:smt2/0. The success typing is () -> #{1:='a'} +opaque_key_use.erl:13: The test opaque_key_use:t() =:= opaque_key_use:t(integer()) can never evaluate to 'true' +opaque_key_use.erl:24: Attempt to test for equality between a term of type opaque_key_adt:t(integer()) and a term of opaque type opaque_key_adt:t() +opaque_key_use.erl:26: Function adt_tt2/0 has no local return +opaque_key_use.erl:37: Function adt_mm1/0 has no local return +opaque_key_use.erl:40: The attempt to match a term of type opaque_key_adt:m() against the pattern #{A:=R} breaks the opaqueness of the term +opaque_key_use.erl:48: Function adt_mu1/0 has no local return +opaque_key_use.erl:51: Guard test is_map(M::opaque_key_adt:m()) breaks the opaqueness of its argument +opaque_key_use.erl:53: Function adt_mu2/0 has no local return +opaque_key_use.erl:56: Guard test is_map(M::opaque_key_adt:m()) breaks the opaqueness of its argument +opaque_key_use.erl:58: Function adt_mu3/0 has no local return +opaque_key_use.erl:60: Guard test is_map(M::opaque_key_adt:m()) breaks the opaqueness of its argument +opaque_key_use.erl:62: Function adt_mtm1/0 has no local return +opaque_key_use.erl:73: Function adt_mtu1/0 has no local return +opaque_key_use.erl:78: Function adt_mtu2/0 has no local return -- cgit v1.2.3