From 4827fa95257c1d68bcdcac2c6d4a35cd8b56d8cd Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 28 Feb 2017 13:08:41 +0100 Subject: dialyzer: Fix an opaque bug An opaque bug that would crash Dialyzer has been fixed. The bug was reported by Nick Marino. --- lib/dialyzer/test/opaque_SUITE_data/results/weird | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 lib/dialyzer/test/opaque_SUITE_data/results/weird (limited to 'lib/dialyzer/test/opaque_SUITE_data/results/weird') diff --git a/lib/dialyzer/test/opaque_SUITE_data/results/weird b/lib/dialyzer/test/opaque_SUITE_data/results/weird new file mode 100644 index 0000000000..cffba85b9f --- /dev/null +++ b/lib/dialyzer/test/opaque_SUITE_data/results/weird @@ -0,0 +1,3 @@ + +weird_warning1.erl:15: The attempt to match a term of type #b{q::queue:queue(_)} against the pattern {'a', Dict} breaks the opacity of queue:queue(_) +weird_warning2.erl:13: The attempt to match a term of type <#a{d::dict:dict(_,_)},'my_key','my_value'> against the pattern <{'b', Queue}, Key, Value> breaks the opacity of dict:dict(_,_) -- cgit v1.2.3 From 0d12ca4bb9fc85e9db980f1f4f990a7c81c5a7a4 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 28 Feb 2017 13:26:38 +0100 Subject: dialyzer: Fix a weird warning --- lib/dialyzer/test/opaque_SUITE_data/results/weird | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/dialyzer/test/opaque_SUITE_data/results/weird') diff --git a/lib/dialyzer/test/opaque_SUITE_data/results/weird b/lib/dialyzer/test/opaque_SUITE_data/results/weird index cffba85b9f..df69c9b6f2 100644 --- a/lib/dialyzer/test/opaque_SUITE_data/results/weird +++ b/lib/dialyzer/test/opaque_SUITE_data/results/weird @@ -1,3 +1,6 @@ weird_warning1.erl:15: The attempt to match a term of type #b{q::queue:queue(_)} against the pattern {'a', Dict} breaks the opacity of queue:queue(_) weird_warning2.erl:13: The attempt to match a term of type <#a{d::dict:dict(_,_)},'my_key','my_value'> against the pattern <{'b', Queue}, Key, Value> breaks the opacity of dict:dict(_,_) +weird_warning3.erl:14: The call weird_warning3:add_element(#a{d::queue:queue(_)},'my_key','my_value') does not have a term of type #a{d::dict:dict(_,_)} | #b{q::queue:queue(_)} (with opaque subterms) as 1st argument +weird_warning3.erl:16: The attempt to match a term of type #a{d::queue:queue(_)} against the pattern {'a', Dict} breaks the opacity of queue:queue(_) +weird_warning3.erl:18: Matching of pattern {'b', Queue} tagged with a record name violates the declared type of #a{d::queue:queue(_)} -- cgit v1.2.3 From 79e0af92ffe050a484d0f00d0dd9c4b4f4e9eb02 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 28 Feb 2017 14:26:15 +0100 Subject: dialyzer: Improve a warning When a pattern a type do not match, opaque warnings were given precedence before structure mismatches. This is no longer always the case. Mentioned by Nick Marino on erlang-questions. --- lib/dialyzer/test/opaque_SUITE_data/results/weird | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/dialyzer/test/opaque_SUITE_data/results/weird') diff --git a/lib/dialyzer/test/opaque_SUITE_data/results/weird b/lib/dialyzer/test/opaque_SUITE_data/results/weird index df69c9b6f2..d7f57cd152 100644 --- a/lib/dialyzer/test/opaque_SUITE_data/results/weird +++ b/lib/dialyzer/test/opaque_SUITE_data/results/weird @@ -1,6 +1,6 @@ -weird_warning1.erl:15: The attempt to match a term of type #b{q::queue:queue(_)} against the pattern {'a', Dict} breaks the opacity of queue:queue(_) -weird_warning2.erl:13: The attempt to match a term of type <#a{d::dict:dict(_,_)},'my_key','my_value'> against the pattern <{'b', Queue}, Key, Value> breaks the opacity of dict:dict(_,_) +weird_warning1.erl:15: Matching of pattern {'a', Dict} tagged with a record name violates the declared type of #b{q::queue:queue(_)} +weird_warning2.erl:13: Matching of pattern <{'b', Queue}, Key, Value> tagged with a record name violates the declared type of <#a{d::dict:dict(_,_)},'my_key','my_value'> weird_warning3.erl:14: The call weird_warning3:add_element(#a{d::queue:queue(_)},'my_key','my_value') does not have a term of type #a{d::dict:dict(_,_)} | #b{q::queue:queue(_)} (with opaque subterms) as 1st argument weird_warning3.erl:16: The attempt to match a term of type #a{d::queue:queue(_)} against the pattern {'a', Dict} breaks the opacity of queue:queue(_) weird_warning3.erl:18: Matching of pattern {'b', Queue} tagged with a record name violates the declared type of #a{d::queue:queue(_)} -- cgit v1.2.3