[erlang-questions 12] Re: dialyzer and ssl

Anders Nygren anders.nygren@REDACTED
Fri Mar 25 19:52:53 CET 2011


According to the documentation transport_accept/2 returns
{ok, NewSocket} | {error, Reason}
Which is what dialyzer also claims. So Your case clause on line 4
can never match.

/Anders

On Thu, Mar 24, 2011 at 2:27 PM, Roberto Ostinelli <roberto@REDACTED> wrote:
> dear list,
>
> i'm getting this dialyzer warning i cannot understand:
>
> "The pattern 'ok' can never match the type {'error',_} |
> {'ok',{'sslsocket',_,_}}"
>
> this points to line 4 of this code extract:
>
> 1. case ssl:transport_accept(ListenSocket) of
> 2.    {ok, {sslsocket, _, _} = Sock} ->
> 3.        case ssl:ssl_accept(Sock, 60000) of
> 4.            ok ->
>                 ...
> 5.            {error, _Reason} ->
>                 ...
> 6.        end
> 7.    {error, _Reason} ->
>         ...
> 8. end
>
> afaik, ssl_accept/2 returns ok | {error, Reason} as per the specs:
> http://www.erlang.org/doc/man/ssl.html#ssl_accept-2
>
> is this due to some discrepancy in docs/specs? or am i missing something?
>
> thank you,
>
> r.
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>



More information about the erlang-questions mailing list