diff options
author | Hans Bolinder <[email protected]> | 2019-02-20 15:51:09 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2019-02-21 07:54:27 +0100 |
commit | b67ddedf0212079204effbb061f31b7366dff95b (patch) | |
tree | b7bf48665230d3269d3aa7c72746234a6b3e835e /lib/hipe | |
parent | f1a00ba58cbfa899d4de2a63b1dbb9a16a9f50ed (diff) | |
download | otp-b67ddedf0212079204effbb061f31b7366dff95b.tar.gz otp-b67ddedf0212079204effbb061f31b7366dff95b.tar.bz2 otp-b67ddedf0212079204effbb061f31b7366dff95b.zip |
dialyzer: Fix maps as parameter of opaque types
The clause added for maps in commit 1a7c41be is corrected.
Diffstat (limited to 'lib/hipe')
-rw-r--r-- | lib/hipe/cerl/erl_types.erl | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index c3b9fd48a1..d61cd8664c 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -3148,9 +3148,18 @@ is_compat_arg(?list(Contents1, Termination1, Size1), is_compat_arg(?product(Types1), ?product(Types2)) -> is_compat_list(Types1, Types2); is_compat_arg(?map(Pairs1, DefK1, DefV1), ?map(Pairs2, DefK2, DefV2)) -> - (is_compat_list(Pairs1, Pairs2) andalso - is_compat_arg(DefK1, DefK2) andalso - is_compat_arg(DefV1, DefV2)); + {Ks1, _, Vs1} = lists:unzip3(Pairs1), + {Ks2, _, Vs2} = lists:unzip3(Pairs2), + Key1 = t_sup([DefK1 | Ks1]), + Key2 = t_sup([DefK2 | Ks2]), + case is_compat_arg(Key1, Key2) of + true -> + Value1 = t_sup([DefV1 | Vs1]), + Value2 = t_sup([DefV2 | Vs2]), + is_compat_arg(Value1, Value2); + false -> + false + end; is_compat_arg(?tuple(?any, ?any, ?any), ?tuple(_, _, _)) -> false; is_compat_arg(?tuple(_, _, _), ?tuple(?any, ?any, ?any)) -> false; is_compat_arg(?tuple(Elements1, Arity, _), |