aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2019-02-08 14:15:11 +0100
committerHans Bolinder <[email protected]>2019-02-08 14:15:11 +0100
commitb3c8e94dd0eae8a01fd4513eff3c2f3741dad193 (patch)
treefcaae9c40a739373e170f4e2abf1951a31dd334b /lib/dialyzer
parent2a1dab38c8a2186a7413eabb2035234cb66f367f (diff)
downloadotp-b3c8e94dd0eae8a01fd4513eff3c2f3741dad193.tar.gz
otp-b3c8e94dd0eae8a01fd4513eff3c2f3741dad193.tar.bz2
otp-b3c8e94dd0eae8a01fd4513eff3c2f3741dad193.zip
dialyzer: Fix a bug affecting keyfind/keysearch/keymember
Diffstat (limited to 'lib/dialyzer')
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/lists_key_bug.erl19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/lists_key_bug.erl b/lib/dialyzer/test/small_SUITE_data/src/lists_key_bug.erl
new file mode 100644
index 0000000000..d7cbc27a4d
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/lists_key_bug.erl
@@ -0,0 +1,19 @@
+-module(lists_key_bug).
+
+%% OTP-15570
+
+-export([t/1]).
+
+t(V) ->
+ K = key(V),
+ case lists:keyfind(K, 1, [{<<"foo">>, bar}]) of
+ false ->
+ a;
+ {_, _} ->
+ b
+ end.
+
+key(1) ->
+ 3;
+key(2) ->
+ <<"foo">>.