dwango / fialyzer

[WIP] Faster Implementation of Dialyzer
https://dwango.github.io/fialyzer/
Apache License 2.0
56 stars 8 forks source link

Support pid, port, reference, and identifier types #271

Closed yuezato closed 5 years ago

yuezato commented 5 years ago

Question: which one of the following is the correct definition?

  1. sup(TyPid, TyPort) = TyPid | TyPort
  2. sup(TyPid, TyPort) = TyIdentifier
yoshihiro503 commented 5 years ago

It's OK: sup(TyPid, TyPort) = TyPid | TyPort

yuezato commented 5 years ago

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().

yoshihiro503 commented 5 years ago

Add some testing cases like:

-spec foo(pid() | port(), (identifier()) -> ok) -> ok.
foo(P, F) ->
  F(P).
yuezato commented 5 years ago

Add the following BIFs

Note: list_to_port may throw the exception badarg.