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/hipe | |
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/hipe')
-rw-r--r-- | lib/hipe/cerl/erl_types.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index d8d707c05e..77a2a7401c 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -1877,6 +1877,7 @@ t_map_put(KV, Map, Opaques) -> %% Key and Value are *not* unopaqued, but the map is map_put(_, ?none, _) -> ?none; +map_put(_, ?unit, _) -> ?none; map_put({Key, Value}, ?map(Pairs,DefK,DefV), Opaques) -> case t_is_none_or_unit(Key) orelse t_is_none_or_unit(Value) of true -> ?none; @@ -1902,6 +1903,7 @@ t_map_update(KV, Map) -> -spec t_map_update({erl_type(), erl_type()}, erl_type(), opaques()) -> erl_type(). t_map_update(_, ?none, _) -> ?none; +t_map_update(_, ?unit, _) -> ?none; t_map_update(KV={Key, _}, M, Opaques) -> case t_is_subtype(t_atom('true'), t_map_is_key(Key, M, Opaques)) of false -> ?none; @@ -1922,6 +1924,7 @@ t_map_get(Key, Map, Opaques) -> end). map_get(_, ?none) -> ?none; +map_get(_, ?unit) -> ?none; map_get(Key, ?map(Pairs, DefK, DefV)) -> DefRes = case t_do_overlap(DefK, Key) of @@ -1957,6 +1960,7 @@ t_map_is_key(Key, Map, Opaques) -> end). map_is_key(_, ?none) -> ?none; +map_is_key(_, ?unit) -> ?none; map_is_key(Key, ?map(Pairs, DefK, _DefV)) -> case is_singleton_type(Key) of true -> |