diff options
author | Björn Gustavsson <[email protected]> | 2018-05-07 10:30:22 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2018-05-07 10:30:22 +0200 |
commit | 7a19de1bf0eb863e0d0febf7e7e5e555c8628575 (patch) | |
tree | 84331df750b98d76b59472ecf2de657121798931 /lib/hipe/cerl | |
parent | 49dc5d3975357971ffc3020d095a8187d80e3b69 (diff) | |
parent | 5d0874a8f9fd617308d9024783db1e4e24268184 (diff) | |
download | otp-7a19de1bf0eb863e0d0febf7e7e5e555c8628575.tar.gz otp-7a19de1bf0eb863e0d0febf7e7e5e555c8628575.tar.bz2 otp-7a19de1bf0eb863e0d0febf7e7e5e555c8628575.zip |
Merge pull request #1802 from michalmuskala/map-is-key-bif
Introduce is_map_key/2 guard BIF
OTP-15037
Diffstat (limited to 'lib/hipe/cerl')
-rw-r--r-- | lib/hipe/cerl/erl_bif_types.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index fe6ab0659c..48ce641ab9 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -665,6 +665,8 @@ type(erlang, is_map, 1, Xs, Opaques) -> check_guard(X, fun (Y) -> t_is_map(Y, Opaques) end, t_map(), Opaques) end, strict(erlang, is_map, 1, Xs, Fun, Opaques); +type(erlang, is_map_key, 2, Xs, Opaques) -> + type(maps, is_key, 2, Xs, Opaques); type(erlang, is_number, 1, Xs, Opaques) -> Fun = fun (X) -> check_guard(X, fun (Y) -> t_is_number(Y, Opaques) end, @@ -2374,6 +2376,8 @@ arg_types(erlang, is_list, 1) -> [t_any()]; arg_types(erlang, is_map, 1) -> [t_any()]; +arg_types(erlang, is_map_key, 2) -> + [t_any(), t_map()]; arg_types(erlang, is_number, 1) -> [t_any()]; arg_types(erlang, is_pid, 1) -> @@ -2396,7 +2400,7 @@ arg_types(erlang, map_size, 1) -> [t_map()]; %% Guard bif, needs to be here. arg_types(erlang, map_get, 2) -> - [t_map(), t_any()]; + [t_any(), t_map()]; arg_types(erlang, make_fun, 3) -> [t_atom(), t_atom(), t_arity()]; arg_types(erlang, make_tuple, 2) -> |