Closed yuezato closed 5 years ago
It's OK:
sup(TyPid, TyPort) = TyPid | TyPort
Finally, we decide to let Fialyzer not have the type Identifier internally.
This decision stands on http://erlang.org/doc/reference_manual/typespec.html, which says identifier()
is the alias of pid() | port() | reference()
.
Add some testing cases like:
-spec foo(pid() | port(), (identifier()) -> ok) -> ok.
foo(P, F) ->
F(P).
Add the following BIFs
self() -> pid()
http://erlang.org/doc/man/erlang.html#self-0is_process_alive(pid()) -> bool()
http://erlang.org/doc/man/erlang.html#is_process_alive-1list_to_port(string()) -> port()
http://erlang.org/doc/man/erlang.html#list_to_port-1port_ot_list(port()) -> string()
http://erlang.org/doc/man/erlang.html#port_to_list-1unlink(pid() | port()) -> true
http://erlang.org/doc/man/erlang.html#unlink-1make_ref() -> reference()
http://erlang.org/doc/man/erlang.html#make_ref-0ref_to_list(reference()) -> string()
http://erlang.org/doc/man/erlang.html#ref_to_list-1Note: list_to_port
may throw the exception badarg
.
Question: which one of the following is the correct definition?
sup(TyPid, TyPort) = TyPid | TyPort
sup(TyPid, TyPort) = TyIdentifier