aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--erts/doc/src/erlang.xml4
-rw-r--r--erts/preloaded/ebin/erlang.beambin84876 -> 84904 bytes
-rw-r--r--erts/preloaded/src/erlang.erl343
-rw-r--r--lib/dialyzer/test/user_SUITE_data/results/wsp_pdu2
-rw-r--r--lib/stdlib/src/ets.erl1
-rw-r--r--lib/stdlib/src/lists.erl5
6 files changed, 189 insertions, 166 deletions
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index e5ea517492..c25e05c6a0 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -1618,6 +1618,10 @@ os_prompt%</pre>
<fsummary>Convert from text representation to an atom</fsummary>
<desc>
<p>Returns the atom whose text representation is <c><anno>String</anno></c>.</p>
+ <p><c><anno>String</anno></c> may only contain ISO-latin-1
+ characterns (i.e. numbers below 256) as the current
+ implementation does not allow unicode characters >= 256 in
+ atoms.</p>
<pre>
> <input>list_to_atom("Erlang").</input>
'Erlang'</pre>
diff --git a/erts/preloaded/ebin/erlang.beam b/erts/preloaded/ebin/erlang.beam
index 01246a34da..e73d55eaec 100644
--- a/erts/preloaded/ebin/erlang.beam
+++ b/erts/preloaded/ebin/erlang.beam
Binary files differ
diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl
index 65ebe83c3a..e042c0a072 100644
--- a/erts/preloaded/src/erlang.erl
+++ b/erts/preloaded/src/erlang.erl
@@ -45,7 +45,7 @@
-deprecated([hash/2]).
-% Get rid of autoimports of spawn to avoid clashes with ourselves.
+%% Get rid of autoimports of spawn to avoid clashes with ourselves.
-compile({no_auto_import,[spawn_link/1]}).
-compile({no_auto_import,[spawn_link/4]}).
-compile({no_auto_import,[spawn_opt/2]}).
@@ -235,20 +235,20 @@
{all, [ trace_info_item_result() ] | false | undefined}.
%% Specs and stubs
-% adler32/1
+%% adler32/1
-spec erlang:adler32(Data) -> non_neg_integer() when
Data :: iodata().
adler32(_Data) ->
erlang:nif_error(undefined).
-% adler32/2
+%% adler32/2
-spec erlang:adler32(OldAdler, Data) -> non_neg_integer() when
OldAdler :: non_neg_integer(),
Data :: iodata().
adler32(_OldAdler, _Data) ->
erlang:nif_error(undefined).
-% adler32_combine/3
+%% adler32_combine/3
-spec erlang:adler32_combine(FirstAdler, SecondAdler, SecondSize) -> non_neg_integer() when
FirstAdler :: non_neg_integer(),
SecondAdler :: non_neg_integer(),
@@ -256,7 +256,7 @@ adler32(_OldAdler, _Data) ->
adler32_combine(_FirstAdler, _SecondAdler, _SecondSize) ->
erlang:nif_error(undefined).
-% append_element/2
+%% append_element/2
-spec erlang:append_element(Tuple1, Term) -> Tuple2 when
Tuple1 :: tuple(),
Tuple2 :: tuple(),
@@ -264,27 +264,29 @@ adler32_combine(_FirstAdler, _SecondAdler, _SecondSize) ->
append_element(_Tuple1, _Term) ->
erlang:nif_error(undefined).
-% atom_to_binary/2
+%% atom_to_binary/2
-spec atom_to_binary(Atom, Encoding) -> binary() when
Atom :: atom(),
Encoding :: latin1 | unicode | utf8.
atom_to_binary(_Atom, _Encoding) ->
erlang:nif_error(undefined).
-% atom_to_list/1
+%% atom_to_list/1
-spec atom_to_list(Atom) -> string() when
Atom :: atom().
atom_to_list(_Atom) ->
erlang:nif_error(undefined).
-% binary_part/2
+%% binary_part/2
+%% Shadowed by erl_bif_types: erlang:binary_part/2
-spec binary_part(Subject, PosLen) -> binary() when
Subject :: binary(),
PosLen :: {Start :: non_neg_integer(), Length :: integer()}.
binary_part(_Subject, _PosLen) ->
erlang:nif_error(undefined).
-% binary_part/3
+%% binary_part/3
+%% Shadowed by erl_bif_types: erlang:binary_part/3
-spec binary_part(Subject, Start, Length) -> binary() when
Subject :: binary(),
Start :: non_neg_integer(),
@@ -292,27 +294,27 @@ binary_part(_Subject, _PosLen) ->
binary_part(_Subject, _Start, _Length) ->
erlang:nif_error(undefined).
-% binary_to_atom/2
+%% binary_to_atom/2
-spec binary_to_atom(Binary, Encoding) -> atom() when
Binary :: binary(),
Encoding :: latin1 | unicode | utf8.
binary_to_atom(_Binary, _Encoding) ->
erlang:nif_error(undefined).
-% binary_to_existing_atom/2
+%% binary_to_existing_atom/2
-spec binary_to_existing_atom(Binary, Encoding) -> atom() when
Binary :: binary(),
Encoding :: latin1 | unicode | utf8.
binary_to_existing_atom(_Binary, _Encoding) ->
erlang:nif_error(undefined).
-% binary_to_list/1
+%% binary_to_list/1
-spec binary_to_list(Binary) -> [byte()] when
Binary :: binary().
binary_to_list(_Binary) ->
erlang:nif_error(undefined).
-% binary_to_list/3
+%% binary_to_list/3
-spec binary_to_list(Binary, Start, Stop) -> [byte()] when
Binary :: binary(),
Start :: pos_integer(),
@@ -320,95 +322,97 @@ binary_to_list(_Binary) ->
binary_to_list(_Binary, _Start, _Stop) ->
erlang:nif_error(undefined).
-% binary_to_term/1
+%% binary_to_term/1
-spec binary_to_term(Binary) -> term() when
Binary :: ext_binary().
binary_to_term(_Binary) ->
erlang:nif_error(undefined).
-% binary_to_term/2
+%% binary_to_term/2
-spec binary_to_term(Binary, Opts) -> term() when
Binary :: ext_binary(),
Opts :: [safe].
binary_to_term(_Binary, _Opts) ->
erlang:nif_error(undefined).
-% bit_size/1
+%% bit_size/1
+%% Shadowed by erl_bif_types: erlang:bit_size/1
-spec bit_size(Bitstring) -> non_neg_integer() when
Bitstring :: bitstring().
bit_size(_Bitstring) ->
erlang:nif_error(undefined).
-% bitsize/1
+%% bitsize/1
-spec bitsize(P1) -> non_neg_integer() when
P1 :: bitstring().
bitsize(_P1) ->
erlang:nif_error(undefined).
-% bitstr_to_list/1
+%% bitstr_to_list/1
-spec erlang:bitstr_to_list(P1) -> [byte() | bitstring()] when
P1 :: bitstring().
bitstr_to_list(_P1) ->
erlang:nif_error(undefined).
-% bitstring_to_list/1
+%% bitstring_to_list/1
-spec bitstring_to_list(Bitstring) -> [byte() | bitstring()] when
Bitstring :: bitstring().
bitstring_to_list(_Bitstring) ->
erlang:nif_error(undefined).
-% bump_reductions/1
+%% bump_reductions/1
-spec erlang:bump_reductions(Reductions) -> true when
Reductions :: pos_integer().
bump_reductions(_Reductions) ->
erlang:nif_error(undefined).
-% byte_size/1
+%% byte_size/1
+%% Shadowed by erl_bif_types: erlang:byte_size/1
-spec byte_size(Bitstring) -> non_neg_integer() when
Bitstring :: bitstring().
byte_size(_Bitstring) ->
erlang:nif_error(undefined).
-% call_on_load_function/1
+%% call_on_load_function/1
-spec erlang:call_on_load_function(P1) -> term() when
P1 :: atom().
call_on_load_function(_P1) ->
erlang:nif_error(undefined).
-% cancel_timer/1
+%% cancel_timer/1
-spec erlang:cancel_timer(TimerRef) -> Time | false when
TimerRef :: reference(),
Time :: non_neg_integer().
cancel_timer(_TimerRef) ->
erlang:nif_error(undefined).
-% check_old_code/1
+%% check_old_code/1
-spec check_old_code(Module) -> boolean() when
Module :: module().
check_old_code(_Module) ->
erlang:nif_error(undefined).
-% check_process_code/2
+%% check_process_code/2
-spec check_process_code(Pid, Module) -> boolean() when
Pid :: pid(),
Module :: module().
check_process_code(_Pid, _Module) ->
erlang:nif_error(undefined).
-% crc32/1
+%% crc32/1
-spec erlang:crc32(Data) -> non_neg_integer() when
Data :: iodata().
crc32(_Data) ->
erlang:nif_error(undefined).
-% crc32/2
+%% crc32/2
-spec erlang:crc32(OldCrc, Data) -> non_neg_integer() when
OldCrc :: non_neg_integer(),
Data :: iodata().
crc32(_OldCrc, _Data) ->
erlang:nif_error(undefined).
-% crc32_combine/3
+%% crc32_combine/3
-spec erlang:crc32_combine(FirstCrc, SecondCrc, SecondSize) -> non_neg_integer() when
FirstCrc :: non_neg_integer(),
SecondCrc :: non_neg_integer(),
@@ -416,13 +420,13 @@ crc32(_OldCrc, _Data) ->
crc32_combine(_FirstCrc, _SecondCrc, _SecondSize) ->
erlang:nif_error(undefined).
-% date/0
+%% date/0
-spec date() -> Date when
Date :: calendar:date().
date() ->
erlang:nif_error(undefined).
-% decode_packet/3
+%% decode_packet/3
-spec erlang:decode_packet(Type, Bin, Options) ->
{ok, Packet, Rest} |
{more, Length} |
@@ -519,19 +523,19 @@ date() ->
decode_packet(_Type, _Bin, _Options) ->
erlang:nif_error(undefined).
-% delete_module/1
+%% delete_module/1
-spec delete_module(Module) -> true | undefined when
Module :: module().
delete_module(_Module) ->
erlang:nif_error(undefined).
-% demonitor/1
+%% demonitor/1
-spec demonitor(MonitorRef) -> true when
MonitorRef :: reference().
demonitor(_MonitorRef) ->
erlang:nif_error(undefined).
-% demonitor/2
+%% demonitor/2
-spec demonitor(MonitorRef, OptionList) -> boolean() when
MonitorRef :: reference(),
OptionList :: [Option],
@@ -539,24 +543,24 @@ demonitor(_MonitorRef) ->
demonitor(_MonitorRef, _OptionList) ->
erlang:nif_error(undefined).
-% display/1
+%% display/1
-spec erlang:display(Term) -> true when
Term :: term().
display(_Term) ->
erlang:nif_error(undefined).
-% display_nl/0
+%% display_nl/0
-spec erlang:display_nl() -> true.
display_nl() ->
erlang:nif_error(undefined).
-% display_string/1
+%% display_string/1
-spec erlang:display_string(P1) -> true when
P1 :: string().
display_string(_P1) ->
erlang:nif_error(undefined).
-% dist_exit/3
+%% dist_exit/3
-spec erlang:dist_exit(P1, P2, P3) -> true when
P1 :: pid(),
P2 :: kill | noconnection | normal,
@@ -564,28 +568,28 @@ display_string(_P1) ->
dist_exit(_P1, _P2, _P3) ->
erlang:nif_error(undefined).
-% erase/0
+%% erase/0
-spec erase() -> [{Key, Val}] when
Key :: term(),
Val :: term().
erase() ->
erlang:nif_error(undefined).
-% erase/1
+%% erase/1
-spec erase(Key) -> Val | undefined when
Key :: term(),
Val :: term().
erase(_Key) ->
erlang:nif_error(undefined).
-% error/1
+%% error/1
%% Shadowed by erl_bif_types: erlang:error/1
-spec error(Reason) -> no_return() when
Reason :: term().
error(_Reason) ->
erlang:nif_error(undefined).
-% error/2
+%% error/2
%% Shadowed by erl_bif_types: erlang:error/2
-spec error(Reason, Args) -> no_return() when
Reason :: term(),
@@ -593,53 +597,54 @@ error(_Reason) ->
error(_Reason, _Args) ->
erlang:nif_error(undefined).
-% exit/1
+%% exit/1
%% Shadowed by erl_bif_types: erlang:exit/1
-spec exit(Reason) -> no_return() when
Reason :: term().
exit(_Reason) ->
erlang:nif_error(undefined).
-% exit/2
+%% exit/2
-spec exit(Pid, Reason) -> true when
Pid :: pid() | port(),
Reason :: term().
exit(_Pid, _Reason) ->
erlang:nif_error(undefined).
-% external_size/1
+%% external_size/1
-spec erlang:external_size(Term) -> non_neg_integer() when
Term :: term().
external_size(_Term) ->
erlang:nif_error(undefined).
-% external_size/2
+%% external_size/2
-spec erlang:external_size(Term, Options) -> non_neg_integer() when
Term :: term(),
Options :: [{minor_version, Version :: non_neg_integer()}].
external_size(_Term, _Options) ->
erlang:nif_error(undefined).
-% finish_after_on_load/2
+%% finish_after_on_load/2
-spec erlang:finish_after_on_load(P1, P2) -> true when
P1 :: atom(),
P2 :: boolean().
finish_after_on_load(_P1, _P2) ->
erlang:nif_error(undefined).
-% float/1
+%% float/1
+%% Shadowed by erl_bif_types: erlang:float/1
-spec float(Number) -> float() when
Number :: number().
float(_Number) ->
erlang:nif_error(undefined).
-% float_to_list/1
+%% float_to_list/1
-spec float_to_list(Float) -> string() when
Float :: float().
float_to_list(_Float) ->
erlang:nif_error(undefined).
-% fun_info/2
+%% fun_info/2
-spec erlang:fun_info(Fun, Item) -> {Item, Info} when
Fun :: function(),
Item :: fun_info_item(),
@@ -647,13 +652,13 @@ float_to_list(_Float) ->
fun_info(_Fun, _Item) ->
erlang:nif_error(undefined).
-% fun_to_list/1
+%% fun_to_list/1
-spec erlang:fun_to_list(Fun) -> string() when
Fun :: function().
fun_to_list(_Fun) ->
erlang:nif_error(undefined).
-% function_exported/3
+%% function_exported/3
-spec erlang:function_exported(Module, Function, Arity) -> boolean() when
Module :: module(),
Function :: atom(),
@@ -661,87 +666,87 @@ fun_to_list(_Fun) ->
function_exported(_Module, _Function, _Arity) ->
erlang:nif_error(undefined).
-% garbage_collect/0
+%% garbage_collect/0
-spec garbage_collect() -> true.
garbage_collect() ->
erlang:nif_error(undefined).
-% garbage_collect/1
+%% garbage_collect/1
-spec garbage_collect(Pid) -> boolean() when
Pid :: pid().
garbage_collect(_Pid) ->
erlang:nif_error(undefined).
-% garbage_collect_message_area/0
+%% garbage_collect_message_area/0
-spec erlang:garbage_collect_message_area() -> boolean().
garbage_collect_message_area() ->
erlang:nif_error(undefined).
-% get/0
+%% get/0
-spec get() -> [{Key, Val}] when
Key :: term(),
Val :: term().
get() ->
erlang:nif_error(undefined).
-% get/1
+%% get/1
-spec get(Key) -> Val | undefined when
Key :: term(),
Val :: term().
get(_Key) ->
erlang:nif_error(undefined).
-% get_keys/1
+%% get_keys/1
-spec get_keys(Val) -> [Key] when
Val :: term(),
Key :: term().
get_keys(_Val) ->
erlang:nif_error(undefined).
-% get_module_info/1
+%% get_module_info/1
-spec erlang:get_module_info(P1) -> [{atom(), [{atom(), term()}]}] when
P1 :: atom().
get_module_info(_P1) ->
erlang:nif_error(undefined).
-% get_stacktrace/0
+%% get_stacktrace/0
-spec erlang:get_stacktrace() -> [stack_item()].
get_stacktrace() ->
erlang:nif_error(undefined).
-% group_leader/0
+%% group_leader/0
-spec group_leader() -> pid().
group_leader() ->
erlang:nif_error(undefined).
-% group_leader/2
+%% group_leader/2
-spec group_leader(GroupLeader, Pid) -> true when
GroupLeader :: pid(),
Pid :: pid().
group_leader(_GroupLeader, _Pid) ->
erlang:nif_error(undefined).
-% halt/0
+%% halt/0
%% Shadowed by erl_bif_types: erlang:halt/0
-spec halt() -> no_return().
halt() ->
erlang:nif_error(undefined).
-% halt/1
+%% halt/1
%% Shadowed by erl_bif_types: erlang:halt/1
-spec halt(Status) -> no_return() when
Status :: non_neg_integer() | string().
halt(_Status) ->
erlang:nif_error(undefined).
-% hash/2
+%% hash/2
-spec erlang:hash(Term, Range) -> pos_integer() when
Term :: term(),
Range :: pos_integer().
hash(_Term, _Range) ->
erlang:nif_error(undefined).
-% hibernate/3
+%% hibernate/3
-spec erlang:hibernate(Module, Function, Args) -> no_return() when
Module :: module(),
Function :: atom(),
@@ -749,30 +754,30 @@ hash(_Term, _Range) ->
hibernate(_Module, _Function, _Args) ->
erlang:nif_error(undefined).
-% integer_to_list/1
+%% integer_to_list/1
-spec integer_to_list(Integer) -> string() when
Integer :: integer().
integer_to_list(_Integer) ->
erlang:nif_error(undefined).
-% iolist_size/1
+%% iolist_size/1
-spec iolist_size(Item) -> non_neg_integer() when
Item :: iolist() | binary().
iolist_size(_Item) ->
erlang:nif_error(undefined).
-% iolist_to_binary/1
+%% iolist_to_binary/1
-spec iolist_to_binary(IoListOrBinary) -> binary() when
IoListOrBinary :: iolist() | binary().
iolist_to_binary(_IoListOrBinary) ->
erlang:nif_error(undefined).
-% is_alive/0
+%% is_alive/0
-spec is_alive() -> boolean().
is_alive() ->
erlang:nif_error(undefined).
-% is_builtin/3
+%% is_builtin/3
-spec erlang:is_builtin(Module, Function, Arity) -> boolean() when
Module :: module(),
Function :: atom(),
@@ -780,96 +785,97 @@ is_alive() ->
is_builtin(_Module, _Function, _Arity) ->
erlang:nif_error(undefined).
-% is_process_alive/1
+%% is_process_alive/1
-spec is_process_alive(Pid) -> boolean() when
Pid :: pid().
is_process_alive(_Pid) ->
erlang:nif_error(undefined).
-% length/1
+%% length/1
+%% Shadowed by erl_bif_types: erlang:length/1
-spec length(List) -> non_neg_integer() when
List :: [term()].
length(_List) ->
erlang:nif_error(undefined).
-% link/1
+%% link/1
-spec link(PidOrPort) -> true when
PidOrPort :: pid() | port().
link(_PidOrPort) ->
erlang:nif_error(undefined).
-% list_to_atom/1
+%% list_to_atom/1
-spec list_to_atom(String) -> atom() when
String :: string().
list_to_atom(_String) ->
erlang:nif_error(undefined).
-% list_to_binary/1
+%% list_to_binary/1
-spec list_to_binary(IoList) -> binary() when
IoList :: iolist().
list_to_binary(_IoList) ->
erlang:nif_error(undefined).
-% list_to_bitstr/1
+%% list_to_bitstr/1
-spec erlang:list_to_bitstr(P1) -> bitstring() when
P1 :: bitstring_list().
list_to_bitstr(_P1) ->
erlang:nif_error(undefined).
-% list_to_bitstring/1
+%% list_to_bitstring/1
-spec list_to_bitstring(BitstringList) -> bitstring() when
BitstringList :: bitstring_list().
list_to_bitstring(_BitstringList) ->
erlang:nif_error(undefined).
-% list_to_existing_atom/1
+%% list_to_existing_atom/1
-spec list_to_existing_atom(String) -> atom() when
String :: string().
list_to_existing_atom(_String) ->
erlang:nif_error(undefined).
-% list_to_float/1
+%% list_to_float/1
-spec list_to_float(String) -> float() when
String :: string().
list_to_float(_String) ->
erlang:nif_error(undefined).
-% list_to_integer/1
+%% list_to_integer/1
-spec list_to_integer(String) -> integer() when
String :: string().
list_to_integer(_String) ->
erlang:nif_error(undefined).
-% list_to_pid/1
+%% list_to_pid/1
-spec list_to_pid(String) -> pid() when
String :: string().
list_to_pid(_String) ->
erlang:nif_error(undefined).
-% list_to_tuple/1
+%% list_to_tuple/1
-spec list_to_tuple(List) -> tuple() when
List :: [term()].
list_to_tuple(_List) ->
erlang:nif_error(undefined).
-% loaded/0
+%% loaded/0
-spec erlang:loaded() -> [Module] when
Module :: module().
loaded() ->
erlang:nif_error(undefined).
-% localtime/0
+%% localtime/0
-spec erlang:localtime() -> DateTime when
DateTime :: calendar:datetime().
localtime() ->
erlang:nif_error(undefined).
-% make_ref/0
+%% make_ref/0
-spec make_ref() -> reference().
make_ref() ->
erlang:nif_error(undefined).
-% match_spec_test/3
+%% match_spec_test/3
-spec erlang:match_spec_test(P1, P2, P3) -> TestResult when
P1 :: [term()] | tuple(),
P2 :: term(),
@@ -878,27 +884,27 @@ make_ref() ->
match_spec_test(_P1, _P2, _P3) ->
erlang:nif_error(undefined).
-% md5/1
+%% md5/1
-spec erlang:md5(Data) -> Digest when
Data :: iodata(),
Digest :: binary().
md5(_Data) ->
erlang:nif_error(undefined).
-% md5_final/1
+%% md5_final/1
-spec erlang:md5_final(Context) -> Digest when
Context :: binary(),
Digest :: binary().
md5_final(_Context) ->
erlang:nif_error(undefined).
-% md5_init/0
+%% md5_init/0
-spec erlang:md5_init() -> Context when
Context :: binary().
md5_init() ->
erlang:nif_error(undefined).
-% md5_update/2
+%% md5_update/2
-spec erlang:md5_update(Context, Data) -> NewContext when
Context :: binary(),
Data :: iodata(),
@@ -906,13 +912,13 @@ md5_init() ->
md5_update(_Context, _Data) ->
erlang:nif_error(undefined).
-% module_loaded/1
+%% module_loaded/1
-spec module_loaded(Module) -> boolean() when
Module :: module().
module_loaded(_Module) ->
erlang:nif_error(undefined).
-% monitor/2
+%% monitor/2
-spec monitor(Type, Item) -> MonitorRef when
Type :: process,
Item :: pid() | Module | {Module, Node},
@@ -922,14 +928,14 @@ module_loaded(_Module) ->
monitor(_Type, _Item) ->
erlang:nif_error(undefined).
-% monitor_node/2
+%% monitor_node/2
-spec monitor_node(Node, Flag) -> true when
Node :: node(),
Flag :: boolean().
monitor_node(_Node, _Flag) ->
erlang:nif_error(undefined).
-% monitor_node/3
+%% monitor_node/3
-spec erlang:monitor_node(Node, Flag, Options) -> true when
Node :: node(),
Flag :: boolean(),
@@ -938,14 +944,14 @@ monitor_node(_Node, _Flag) ->
monitor_node(_Node, _Flag, _Options) ->
erlang:nif_error(undefined).
-% nif_error/1
+%% nif_error/1
%% Shadowed by erl_bif_types: erlang:nif_error/1
-spec erlang:nif_error(Reason) -> no_return() when
Reason :: term().
nif_error(_Reason) ->
erlang:nif_error(undefined).
-% nif_error/2
+%% nif_error/2
%% Shadowed by erl_bif_types: erlang:nif_error/2
-spec erlang:nif_error(Reason, Args) -> no_return() when
Reason :: term(),
@@ -953,26 +959,28 @@ nif_error(_Reason) ->
nif_error(_Reason, _Args) ->
erlang:nif_error(undefined).
-% node/0
+%% node/0
+%% Shadowed by erl_bif_types: erlang:node/0
-spec node() -> Node when
Node :: node().
node() ->
erlang:nif_error(undefined).
-% node/1
+%% node/1
+%% Shadowed by erl_bif_types: erlang:node/1
-spec node(Arg) -> Node when
Arg :: pid() | port() | reference(),
Node :: node().
node(_Arg) ->
erlang:nif_error(undefined).
-% now/0
+%% now/0
-spec now() -> Timestamp when
Timestamp :: timestamp().
now() ->
erlang:nif_error(undefined).
-% phash/2
+%% phash/2
-spec erlang:phash(Term, Range) -> Hash when
Term :: term(),
Range :: pos_integer(),
@@ -980,14 +988,14 @@ now() ->
phash(_Term, _Range) ->
erlang:nif_error(undefined).
-% phash2/1
+%% phash2/1
-spec erlang:phash2(Term) -> Hash when
Term :: term(),
Hash :: non_neg_integer().
phash2(_Term) ->
erlang:nif_error(undefined).
-% phash2/2
+%% phash2/2
-spec erlang:phash2(Term, Range) -> Hash when
Term :: term(),
Range :: pos_integer(),
@@ -995,26 +1003,26 @@ phash2(_Term) ->
phash2(_Term, _Range) ->
erlang:nif_error(undefined).
-% pid_to_list/1
+%% pid_to_list/1
-spec pid_to_list(Pid) -> string() when
Pid :: pid().
pid_to_list(_Pid) ->
erlang:nif_error(undefined).
-% port_close/1
+%% port_close/1
-spec port_close(Port) -> true when
Port :: port() | atom().
port_close(_Port) ->
erlang:nif_error(undefined).
-% port_command/2
+%% port_command/2
-spec port_command(Port, Data) -> true when
Port :: port() | atom(),
Data :: iodata().
port_command(_Port, _Data) ->
erlang:nif_error(undefined).
-% port_command/3
+%% port_command/3
-spec port_command(Port, Data, OptionList) -> boolean() when
Port :: port() | atom(),
Data :: iodata(),
@@ -1023,14 +1031,14 @@ port_command(_Port, _Data) ->
port_command(_Port, _Data, _OptionList) ->
erlang:nif_error(undefined).
-% port_connect/2
+%% port_connect/2
-spec port_connect(Port, Pid) -> true when
Port :: port() | atom(),
Pid :: pid().
port_connect(_Port, _Pid) ->
erlang:nif_error(undefined).
-% port_control/3
+%% port_control/3
-spec port_control(Port, Operation, Data) -> Res when
Port :: port() | atom(),
Operation :: integer(),
@@ -1039,49 +1047,49 @@ port_connect(_Port, _Pid) ->
port_control(_Port, _Operation, _Data) ->
erlang:nif_error(undefined).
-% port_get_data/1
+%% port_get_data/1
-spec erlang:port_get_data(P1) -> term() when
P1 :: port() | atom().
port_get_data(_P1) ->
erlang:nif_error(undefined).
-% port_set_data/2
+%% port_set_data/2
-spec erlang:port_set_data(P1, P2) -> true when
P1 :: port() | atom(),
P2 :: term().
port_set_data(_P1, _P2) ->
erlang:nif_error(undefined).
-% port_to_list/1
+%% port_to_list/1
-spec erlang:port_to_list(Port) -> string() when
Port :: port().
port_to_list(_Port) ->
erlang:nif_error(undefined).
-% ports/0
+%% ports/0
-spec erlang:ports() -> [port()].
ports() ->
erlang:nif_error(undefined).
-% posixtime_to_universaltime/1
+%% posixtime_to_universaltime/1
-spec erlang:posixtime_to_universaltime(P1) -> {calendar:date(), calendar:time()} when
P1 :: integer().
posixtime_to_universaltime(_P1) ->
erlang:nif_error(undefined).
-% pre_loaded/0
+%% pre_loaded/0
-spec pre_loaded() -> [module()].
pre_loaded() ->
erlang:nif_error(undefined).
-% process_display/2
+%% process_display/2
-spec erlang:process_display(Pid, Type) -> true when
Pid :: pid(),
Type :: backtrace.
process_display(_Pid, _Type) ->
erlang:nif_error(undefined).
-% process_flag/3
+%% process_flag/3
-spec process_flag(Pid, Flag, Value) -> OldValue when
Pid :: pid(),
Flag :: save_calls,
@@ -1090,7 +1098,7 @@ process_display(_Pid, _Type) ->
process_flag(_Pid, _Flag, _Value) ->
erlang:nif_error(undefined).
-% process_info/1
+%% process_info/1
-spec process_info(Pid) -> Info when
Pid :: pid(),
Info :: [InfoTuple] | undefined,
@@ -1098,25 +1106,25 @@ process_flag(_Pid, _Flag, _Value) ->
process_info(_Pid) ->
erlang:nif_error(undefined).
-% processes/0
+%% processes/0
-spec processes() -> [pid()].
processes() ->
erlang:nif_error(undefined).
-% purge_module/1
+%% purge_module/1
-spec purge_module(Module) -> true when
Module :: atom().
purge_module(_Module) ->
erlang:nif_error(undefined).
-% put/2
+%% put/2
-spec put(Key, Val) -> term() when
Key :: term(),
Val :: term().
put(_Key, _Val) ->
erlang:nif_error(undefined).
-% raise/3
+%% raise/3
-spec erlang:raise(Class, Reason, Stacktrace) -> no_return() when
Class :: error | exit | throw,
Reason :: term(),
@@ -1124,49 +1132,51 @@ put(_Key, _Val) ->
raise(_Class, _Reason, _Stacktrace) ->
erlang:nif_error(undefined).
-% read_timer/1
+%% read_timer/1
-spec erlang:read_timer(TimerRef) -> non_neg_integer() | false when
TimerRef :: reference().
read_timer(_TimerRef) ->
erlang:nif_error(undefined).
-% ref_to_list/1
+%% ref_to_list/1
-spec erlang:ref_to_list(Ref) -> string() when
Ref :: reference().
ref_to_list(_Ref) ->
erlang:nif_error(undefined).
-% register/2
+%% register/2
-spec register(RegName, PidOrPort) -> true when
RegName :: atom(),
PidOrPort :: port() | pid().
register(_RegName, _PidOrPort) ->
erlang:nif_error(undefined).
-% registered/0
+%% registered/0
-spec registered() -> [RegName] when
RegName :: atom().
registered() ->
erlang:nif_error(undefined).
-% resume_process/1
+%% resume_process/1
-spec erlang:resume_process(Suspendee) -> true when
Suspendee :: pid().
resume_process(_Suspendee) ->
erlang:nif_error(undefined).
-% round/1
+%% round/1
+%% Shadowed by erl_bif_types: erlang:round/1
-spec round(Number) -> integer() when
Number :: number().
round(_Number) ->
erlang:nif_error(undefined).
-% self/0
+%% self/0
+%% Shadowed by erl_bif_types: erlang:self/0
-spec self() -> pid().
self() ->
erlang:nif_error(undefined).
-% send_after/3
+%% send_after/3
-spec erlang:send_after(Time, Dest, Msg) -> TimerRef when
Time :: non_neg_integer(),
Dest :: pid() | atom(),
@@ -1175,34 +1185,34 @@ self() ->
send_after(_Time, _Dest, _Msg) ->
erlang:nif_error(undefined).
-% seq_trace/2
+%% seq_trace/2
-spec erlang:seq_trace(P1, P2) -> seq_trace_info_returns() | {term(), term(), term(), term(), term()} when
P1 :: atom(),
P2 :: boolean() | {integer(), integer()} | integer() | [].
seq_trace(_P1, _P2) ->
erlang:nif_error(undefined).
-% seq_trace_print/1
+%% seq_trace_print/1
-spec erlang:seq_trace_print(P1) -> boolean() when
P1 :: term().
seq_trace_print(_P1) ->
erlang:nif_error(undefined).
-% seq_trace_print/2
+%% seq_trace_print/2
-spec erlang:seq_trace_print(P1, P2) -> boolean() when
P1 :: atom() | integer(),
P2 :: term().
seq_trace_print(_P1, _P2) ->
erlang:nif_error(undefined).
-% setnode/2
+%% setnode/2
-spec erlang:setnode(P1, P2) -> true when
P1 :: atom(),
P2 :: integer().
setnode(_P1, _P2) ->
erlang:nif_error(undefined).
-% setnode/3
+%% setnode/3
-spec erlang:setnode(P1, P2, P3) -> true when
P1 :: atom(),
P2 :: port(),
@@ -1210,13 +1220,14 @@ setnode(_P1, _P2) ->
setnode(_P1, _P2, _P3) ->
erlang:nif_error(undefined).
-% size/1
+%% size/1
+%% Shadowed by erl_bif_types: erlang:size/1
-spec size(Item) -> non_neg_integer() when
Item :: tuple() | binary().
size(_Item) ->
erlang:nif_error(undefined).
-% spawn/3
+%% spawn/3
-spec spawn(Module, Function, Args) -> pid() when
Module :: module(),
Function :: atom(),
@@ -1224,7 +1235,7 @@ size(_Item) ->
spawn(_Module, _Function, _Args) ->
erlang:nif_error(undefined).
-% spawn_link/3
+%% spawn_link/3
-spec spawn_link(Module, Function, Args) -> pid() when
Module :: module(),
Function :: atom(),
@@ -1232,14 +1243,14 @@ spawn(_Module, _Function, _Args) ->
spawn_link(_Module, _Function, _Args) ->
erlang:nif_error(undefined).
-% split_binary/2
+%% split_binary/2
-spec split_binary(Bin, Pos) -> {binary(), binary()} when
Bin :: binary(),
Pos :: non_neg_integer().
split_binary(_Bin, _Pos) ->
erlang:nif_error(undefined).
-% start_timer/3
+%% start_timer/3
-spec erlang:start_timer(Time, Dest, Msg) -> TimerRef when
Time :: non_neg_integer(),
Dest :: pid() | atom(),
@@ -1248,7 +1259,7 @@ split_binary(_Bin, _Pos) ->
start_timer(_Time, _Dest, _Msg) ->
erlang:nif_error(undefined).
-% suspend_process/2
+%% suspend_process/2
-spec erlang:suspend_process(Suspendee, OptList) -> boolean() when
Suspendee :: pid(),
OptList :: [Opt],
@@ -1256,7 +1267,7 @@ start_timer(_Time, _Dest, _Msg) ->
suspend_process(_Suspendee, _OptList) ->
erlang:nif_error(undefined).
-% system_monitor/0
+%% system_monitor/0
-spec erlang:system_monitor() -> MonSettings when
MonSettings :: undefined | { MonitorPid, Options },
MonitorPid :: pid(),
@@ -1264,7 +1275,7 @@ suspend_process(_Suspendee, _OptList) ->
system_monitor() ->
erlang:nif_error(undefined).
-% system_monitor/1
+%% system_monitor/1
-spec erlang:system_monitor(Arg) -> MonSettings when
Arg :: undefined | { MonitorPid, Options },
MonSettings :: undefined | { MonitorPid, Options },
@@ -1273,7 +1284,7 @@ system_monitor() ->
system_monitor(_Arg) ->
erlang:nif_error(undefined).
-% system_monitor/2
+%% system_monitor/2
-spec erlang:system_monitor(MonitorPid, Options) -> MonSettings when
MonitorPid :: pid(),
Options :: [ system_monitor_option() ],
@@ -1283,7 +1294,7 @@ system_monitor(_Arg) ->
system_monitor(_MonitorPid, _Options) ->
erlang:nif_error(undefined).
-% system_profile/0
+%% system_profile/0
-spec erlang:system_profile() -> ProfilerSettings when
ProfilerSettings :: undefined | { ProfilerPid, Options},
ProfilerPid :: pid() | port(),
@@ -1291,7 +1302,7 @@ system_monitor(_MonitorPid, _Options) ->
system_profile() ->
erlang:nif_error(undefined).
-% system_profile/2
+%% system_profile/2
-spec erlang:system_profile(ProfilerPid, Options) -> ProfilerSettings when
ProfilerPid :: pid() | port() | undefined,
Options :: [ system_profile_option() ],
@@ -1299,20 +1310,20 @@ system_profile() ->
system_profile(_ProfilerPid, _Options) ->
erlang:nif_error(undefined).
-% throw/1
+%% throw/1
%% Shadowed by erl_bif_types: erlang:throw/1
-spec throw(Any) -> no_return() when
Any :: term().
throw(_Any) ->
erlang:nif_error(undefined).
-% time/0
+%% time/0
-spec time() -> Time when
Time :: calendar:time().
time() ->
erlang:nif_error(undefined).
-% trace/3
+%% trace/3
-spec erlang:trace(PidSpec, How, FlagList) -> integer() when
PidSpec :: pid() | existing | new | all,
How :: boolean(),
@@ -1320,14 +1331,14 @@ time() ->
trace(_PidSpec, _How, _FlagList) ->
erlang:nif_error(undefined).
-% trace_delivered/1
+%% trace_delivered/1
-spec erlang:trace_delivered(Tracee) -> Ref when
Tracee :: pid() | all,
Ref :: reference().
trace_delivered(_Tracee) ->
erlang:nif_error(undefined).
-% trace_info/2
+%% trace_info/2
-spec erlang:trace_info(PidOrFunc, Item) -> Res when
PidOrFunc :: pid() | new | {Module, Function, Arity} | on_load,
Module :: module(),
@@ -1338,43 +1349,45 @@ trace_delivered(_Tracee) ->
trace_info(_PidOrFunc, _Item) ->
erlang:nif_error(undefined).
-% trunc/1
+%% trunc/1
+%% Shadowed by erl_bif_types: erlang:trunc/1
-spec trunc(Number) -> integer() when
Number :: number().
trunc(_Number) ->
erlang:nif_error(undefined).
-% tuple_size/1
+%% tuple_size/1
+%% Shadowed by erl_bif_types: erlang:tuple_size/1
-spec tuple_size(Tuple) -> non_neg_integer() when
Tuple :: tuple().
tuple_size(_Tuple) ->
erlang:nif_error(undefined).
-% universaltime/0
+%% universaltime/0
-spec erlang:universaltime() -> DateTime when
DateTime :: calendar:datetime().
universaltime() ->
erlang:nif_error(undefined).
-% universaltime_to_posixtime/1
+%% universaltime_to_posixtime/1
-spec erlang:universaltime_to_posixtime(P1) -> integer() when
P1 :: {calendar:date(), calendar:time()}.
universaltime_to_posixtime(_P1) ->
erlang:nif_error(undefined).
-% unlink/1
+%% unlink/1
-spec unlink(Id) -> true when
Id :: pid() | port().
unlink(_Id) ->
erlang:nif_error(undefined).
-% unregister/1
+%% unregister/1
-spec unregister(RegName) -> true when
RegName :: atom().
unregister(_RegName) ->
erlang:nif_error(undefined).
-% whereis/1
+%% whereis/1
-spec whereis(RegName) -> pid() | port() | undefined when
RegName :: atom().
whereis(_RegName) ->
@@ -1817,7 +1830,7 @@ seq_trace_info(_What) ->
setelement(_Index, _Tuple1, _Value) ->
erlang:nif_error(undefined).
--spec spawn_opt({Module, Function, Args, Options}) -> pid() | {pid(), reference()} when
+-spec erlang:spawn_opt({Module, Function, Args, Options}) -> pid() | {pid(), reference()} when
Module :: module(),
Function :: atom(),
Args :: [term()],
@@ -2002,7 +2015,7 @@ tuple_to_list(_Tuple) ->
(compat_rel) -> integer();
(cpu_topology) -> CpuTopology when
CpuTopology :: cpu_topology();
- ({cpu_topoology, defined | detected | used}) -> CpuTopology when
+ ({cpu_topology, defined | detected | used}) -> CpuTopology when
CpuTopology :: cpu_topology();
(creation) -> integer();
(debug_compiled) -> boolean();
@@ -2430,7 +2443,7 @@ suspend_process(P) ->
%% reactivate the command.
%%
--spec dlink(pid() | port()) -> 'true'.
+-spec erlang:dlink(pid() | port()) -> 'true'.
dlink(Pid) ->
case net_kernel:connect(erlang:node(Pid)) of
true -> erlang:link(Pid);
@@ -2438,7 +2451,7 @@ dlink(Pid) ->
end.
%% Can this ever happen?
--spec dunlink(identifier()) -> 'true'.
+-spec erlang:dunlink(identifier()) -> 'true'.
dunlink(Pid) ->
case net_kernel:connect(erlang:node(Pid)) of
true -> erlang:unlink(Pid);
@@ -2508,7 +2521,7 @@ dsend({Name, Node}, Msg, Opts) ->
ignored -> ok % Not distributed.
end.
--spec dmonitor_p('process', pid() | {atom(),atom()}) -> reference().
+-spec erlang:dmonitor_p('process', pid() | {atom(),atom()}) -> reference().
dmonitor_p(process, ProcSpec) ->
%% ProcSpec = pid() | {atom(),atom()}
%% ProcSpec CANNOT be an atom because a locally registered process
@@ -2532,7 +2545,7 @@ dmonitor_p(process, ProcSpec) ->
%% Trap function used when modified timing has been enabled.
%%
--spec delay_trap(Result, timeout()) -> Result.
+-spec erlang:delay_trap(Result, timeout()) -> Result.
delay_trap(Result, 0) -> erlang:yield(), Result;
delay_trap(Result, Timeout) -> receive after Timeout -> Result end.
@@ -2799,7 +2812,7 @@ rvrs([X|Xs],Ys) -> rvrs(Xs, [X|Ys]).
%% functions in bif.c. Do not make
%% any changes to it without reading
%% the comment about them in bif.c!
--spec await_proc_exit(dst(), 'apply' | 'data' | 'reason', term()) -> term().
+-spec erlang:await_proc_exit(dst(), 'apply' | 'data' | 'reason', term()) -> term().
await_proc_exit(Proc, Op, Data) ->
Mon = erlang:monitor(process, Proc),
receive
@@ -2858,7 +2871,7 @@ max(A, _) -> A.
low = 0,
maximum = 0}).
--spec memory() -> [{Type, Size}] when
+-spec erlang:memory() -> [{Type, Size}] when
Type :: memory_type(),
Size :: non_neg_integer().
memory() ->
diff --git a/lib/dialyzer/test/user_SUITE_data/results/wsp_pdu b/lib/dialyzer/test/user_SUITE_data/results/wsp_pdu
index a47b1f1f2c..d1f8f4caf2 100644
--- a/lib/dialyzer/test/user_SUITE_data/results/wsp_pdu
+++ b/lib/dialyzer/test/user_SUITE_data/results/wsp_pdu
@@ -6,7 +6,7 @@ wsp_pdu.erl:2403: The call wsp_pdu:d_date(Data1::binary()) will never return sin
wsp_pdu.erl:2406: Guard test is_integer(Sec::{[byte()] | byte() | {'long',binary()} | {'short',binary()},binary()}) can never succeed
wsp_pdu.erl:2408: The pattern {'short', Data2} can never match the type {[byte()] | byte() | {'long',binary()} | {'short',binary()},binary()}
wsp_pdu.erl:2755: Function parse_push_flag/1 has no local return
-wsp_pdu.erl:2756: The call erlang:integer_to_list(Value::[any()]) will never return since it differs in the 1st argument from the success typing arguments: (integer())
+wsp_pdu.erl:2756: The call erlang:integer_to_list(Value::[any()]) breaks the contract (Integer) -> string() when is_subtype(Integer,integer())
wsp_pdu.erl:2875: The call wsp_pdu:d_text_string(Data::byte()) will never return since it differs in the 1st argument from the success typing arguments: (binary())
wsp_pdu.erl:2976: The call wsp_pdu:d_q_value(QData::byte()) will never return since it differs in the 1st argument from the success typing arguments: (<<_:8,_:_*8>>)
wsp_pdu.erl:3336: The call wsp_pdu:encode_typed_field(Ver::any(),'Q-value',ParamValue::any()) will never return since it differs in the 2nd argument from the success typing arguments: (any(),'Constrained-encoding' | 'Date-value' | 'No-value' | 'Short-integer' | 'Text-string' | 'Text-value' | 'Well-known-charset',any())
diff --git a/lib/stdlib/src/ets.erl b/lib/stdlib/src/ets.erl
index 4a96808810..817b397cc4 100644
--- a/lib/stdlib/src/ets.erl
+++ b/lib/stdlib/src/ets.erl
@@ -301,6 +301,7 @@ next(_, _) ->
prev(_, _) ->
erlang:nif_error(undef).
+%% Shadowed by erl_bif_types: ets:rename/2
-spec rename(Tab, Name) -> Name when
Tab :: tab(),
Name :: atom().
diff --git a/lib/stdlib/src/lists.erl b/lib/stdlib/src/lists.erl
index d4f14dc8f5..eb527471d5 100644
--- a/lib/stdlib/src/lists.erl
+++ b/lib/stdlib/src/lists.erl
@@ -43,6 +43,7 @@
%%% BIFs
-export([keyfind/3, keymember/3, keysearch/3, member/2, reverse/2]).
+%% Shadowed by erl_bif_types: lists:keyfind/3
-spec keyfind(Key, N, TupleList) -> Tuple | false when
Key :: term(),
N :: pos_integer(),
@@ -52,6 +53,7 @@
keyfind(_, _, _) ->
erlang:nif_error(undef).
+%% Shadowed by erl_bif_types: lists:keymember/3
-spec keymember(Key, N, TupleList) -> boolean() when
Key :: term(),
N :: pos_integer(),
@@ -61,6 +63,7 @@ keyfind(_, _, _) ->
keymember(_, _, _) ->
erlang:nif_error(undef).
+%% Shadowed by erl_bif_types: lists:keysearch/3
-spec keysearch(Key, N, TupleList) -> {value, Tuple} | false when
Key :: term(),
N :: pos_integer(),
@@ -70,6 +73,7 @@ keymember(_, _, _) ->
keysearch(_, _, _) ->
erlang:nif_error(undef).
+%% Shadowed by erl_bif_types: lists:member/2
-spec member(Elem, List) -> boolean() when
Elem :: T,
List :: [T],
@@ -78,6 +82,7 @@ keysearch(_, _, _) ->
member(_, _) ->
erlang:nif_error(undef).
+%% Shadowed by erl_bif_types: lists:reverse/2
-spec reverse(List1, Tail) -> List2 when
List1 :: [T],
Tail :: term(),