diff options
author | Björn Gustavsson <[email protected]> | 2018-04-25 10:34:26 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-04-25 10:34:26 +0200 |
commit | 3682b7dab5a67843e54f0a93cc00a08b235c20c7 (patch) | |
tree | ba8c5d7d660c3ab387e2d250cf520e1b784cf3d9 /erts/preloaded/src/erlang.erl | |
parent | 0e669ed13e20d5d68aa617aacd807eca7268d070 (diff) | |
parent | ad72c0d37ffb214cac874f51ac29fe2cdb47a2a4 (diff) | |
download | otp-3682b7dab5a67843e54f0a93cc00a08b235c20c7.tar.gz otp-3682b7dab5a67843e54f0a93cc00a08b235c20c7.tar.bz2 otp-3682b7dab5a67843e54f0a93cc00a08b235c20c7.zip |
Merge branch 'map-get-bif' of git://github.com/michalmuskala/otp
* 'map-get-bif' of git://github.com/michalmuskala/otp:
Introduce map_get guard-safe function
OTP-15037
Diffstat (limited to 'erts/preloaded/src/erlang.erl')
-rw-r--r-- | erts/preloaded/src/erlang.erl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl index 6fad5adde8..53e90a4f2d 100644 --- a/erts/preloaded/src/erlang.erl +++ b/erts/preloaded/src/erlang.erl @@ -141,7 +141,7 @@ -export([list_to_integer/1, list_to_integer/2]). -export([list_to_pid/1, list_to_port/1, list_to_ref/1, list_to_tuple/1, loaded/0]). -export([localtime/0, make_ref/0]). --export([map_size/1, match_spec_test/3, md5/1, md5_final/1]). +-export([map_size/1, map_get/2, match_spec_test/3, md5/1, md5_final/1]). -export([md5_init/0, md5_update/2, module_loaded/1, monitor/2]). -export([monitor_node/2, monitor_node/3, nif_error/1, nif_error/2]). -export([node/0, node/1, now/0, phash/2, phash2/1, phash2/2]). @@ -1230,6 +1230,14 @@ make_ref() -> map_size(_Map) -> erlang:nif_error(undefined). +%% Shadowed by erl_bif_types: erlang:map_get/2 +-spec map_get(Key, Map) -> Value when + Map :: map(), + Key :: any(), + Value :: any(). +map_get(_Key, _Map) -> + erlang:nif_error(undefined). + %% match_spec_test/3 -spec erlang:match_spec_test(MatchAgainst, MatchSpec, Type) -> TestResult when MatchAgainst :: [term()] | tuple(), @@ -3938,4 +3946,3 @@ gc_info(Ref, N, {OrigColls,OrigRecl}) -> {Ref, {_,Colls, Recl}} -> gc_info(Ref, N-1, {Colls+OrigColls,Recl+OrigRecl}) end. - |