diff options
author | Hans Bolinder <[email protected]> | 2017-02-28 13:08:41 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2017-02-28 14:37:15 +0100 |
commit | 4827fa95257c1d68bcdcac2c6d4a35cd8b56d8cd (patch) | |
tree | 0e7de02605cba86d03081b921b1488bc6ca7d21f /lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning1.erl | |
parent | 02b31b9229a8631a1ecd9b1de90aa7620f46084b (diff) | |
download | otp-4827fa95257c1d68bcdcac2c6d4a35cd8b56d8cd.tar.gz otp-4827fa95257c1d68bcdcac2c6d4a35cd8b56d8cd.tar.bz2 otp-4827fa95257c1d68bcdcac2c6d4a35cd8b56d8cd.zip |
dialyzer: Fix an opaque bug
An opaque bug that would crash Dialyzer has been fixed.
The bug was reported by Nick Marino.
Diffstat (limited to 'lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning1.erl')
-rw-r--r-- | lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning1.erl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning1.erl b/lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning1.erl new file mode 100644 index 0000000000..094138e72b --- /dev/null +++ b/lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning1.erl @@ -0,0 +1,18 @@ +-module(weird_warning1). +-export([public_func/0]). + +-record(a, { + d = dict:new() :: dict:dict() + }). + +-record(b, { + q = queue:new() :: queue:queue() + }). + +public_func() -> + add_element(#b{}, my_key, my_value). + +add_element(#a{d = Dict}, Key, Value) -> + dict:store(Key, Value, Dict); +add_element(#b{q = Queue}, Key, Value) -> + queue:in({Key, Value}, Queue). |