diff options
author | Hans Bolinder <[email protected]> | 2017-11-28 12:52:29 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2017-11-28 12:52:29 +0100 |
commit | 779ea5fecf0e0ba525410a3dcb4ea84d12b5c77f (patch) | |
tree | 3e6faa7d134711a7ea8c7a432f8455a82ab062a5 /lib/dialyzer/src | |
parent | 77cbfba55b7d4d4c4f50a32716b69dbd53c8415c (diff) | |
parent | 59ca0ddeb08d6ec433fa50eaa0a7175a09766b83 (diff) | |
download | otp-779ea5fecf0e0ba525410a3dcb4ea84d12b5c77f.tar.gz otp-779ea5fecf0e0ba525410a3dcb4ea84d12b5c77f.tar.bz2 otp-779ea5fecf0e0ba525410a3dcb4ea84d12b5c77f.zip |
Merge branch 'maint'
* maint:
dialyzer: Extend the map implementation's handling of ?unit
dialyzer: Use string:find() instead of string:str()
Diffstat (limited to 'lib/dialyzer/src')
-rw-r--r-- | lib/dialyzer/src/dialyzer_typesig.erl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/dialyzer/src/dialyzer_typesig.erl b/lib/dialyzer/src/dialyzer_typesig.erl index c4d8f45447..d03326ec97 100644 --- a/lib/dialyzer/src/dialyzer_typesig.erl +++ b/lib/dialyzer/src/dialyzer_typesig.erl @@ -41,7 +41,7 @@ t_is_float/1, t_is_fun/1, t_is_integer/1, t_non_neg_integer/0, t_is_list/1, t_is_nil/1, t_is_none/1, t_is_number/1, - t_is_singleton/1, + t_is_singleton/1, t_is_none_or_unit/1, t_limit/2, t_list/0, t_list/1, t_list_elements/1, t_nonempty_list/1, t_maybe_improper_list/0, @@ -528,13 +528,14 @@ traverse(Tree, DefinedVars, State) -> false -> t_any(); true -> MT = t_inf(lookup_type(MapVar, Map), t_map()), - case t_is_none(MT) of + case t_is_none_or_unit(MT) of true -> t_none(); false -> DisjointFromKeyType = fun(ShadowKey) -> - t_is_none(t_inf(lookup_type(ShadowKey, Map), - KeyType)) + ST = t_inf(lookup_type(ShadowKey, Map), + KeyType), + t_is_none_or_unit(ST) end, case lists:all(DisjointFromKeyType, ShadowKeys) of true -> t_map_get(KeyType, MT); @@ -567,7 +568,8 @@ traverse(Tree, DefinedVars, State) -> case cerl:is_literal(OpTree) andalso cerl:concrete(OpTree) =:= exact of true -> - case t_is_none(t_inf(ShadowedKeys, KeyType)) of + ST = t_inf(ShadowedKeys, KeyType), + case t_is_none_or_unit(ST) of true -> t_map_put({KeyType, t_any()}, AccType); false -> |