From f1a00ba58cbfa899d4de2a63b1dbb9a16a9f50ed Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 12 Feb 2019 12:48:31 +0100 Subject: dialyzer: Fix key check of lists:key{search,member,find}() Replace integers and floats with t_number() since keysearch et al compare the key (rather than match). Corrects the commit b3c8e94. --- lib/hipe/cerl/erl_bif_types.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/hipe/cerl/erl_bif_types.erl') diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index 799957dfdc..8ae1cd4ab7 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -2224,7 +2224,8 @@ type_order() -> [t_number(), t_atom(), t_reference(), t_fun(), t_port(), t_pid(), t_tuple(), t_map(), t_list(), t_bitstr()]. -key_comparisons_fail(X, KeyPos, TupleList, Opaques) -> +key_comparisons_fail(X0, KeyPos, TupleList, Opaques) -> + X = erl_types:t_widen_to_number(X0), lists:all(fun(Tuple) -> Key = type(erlang, element, 2, [KeyPos, Tuple]), t_is_none(t_inf(Key, X, Opaques)) -- cgit v1.2.3