[erlang-questions] Dialyzer warning about patterns
Yash Ganthe
yash_ganthe@REDACTED
Tue Jul 9 08:06:58 CEST 2013
Hi,
I have the following code:
Port = open_port({spawn,Args},[{packet,2}]),
case is_port(Port) of
true ->
io:format("~n ~p port created successfully ~n",[Port]),
ok;
false -> %%Line 52
io:format("something went wrong ~n"),
failed
end.
Dialyzer gives the following warning:
mymod.erl:52: The pattern 'false' can never match the type 'true'
The possible results of is_port are true and false considering
is_port(Term) -> boolean()
What do I need to do to get rid of such warnings?
Thanks,
Yash
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130709/8c1e7eb7/attachment.htm>
More information about the erlang-questions
mailing list