[erlang-questions] httph_bin works, but missing from type spec

Kostis Sagonas <>
Sat Mar 20 07:12:24 CET 2010


Jay Nelson wrote:
> http_reply.erl:147:
> 
>    The call erlang:decode_packet('httph_bin',Binary::binary(),[]) will 
> never return since it differs in the 1st argument from the success 
> typing arguments:
> 
>      ('asn1' | 'cdr' | 'fcgi' | 'http' | 'http_bin' | 'httph' | 'line' | 
> 'raw' | 'sunrm' | 'tpkt' | 0 | 1 | 2 | 4,binary(),
>      [{'line_length',non_neg_integer()} | 
> {'packet_size',non_neg_integer()}])
> 
> 
> The function works just fine but dialyzer complains.

This can be fixed by the following patch, which will also appear in R14.

Kostis

================
RCS file: /hipe/otp/lib/hipe/cerl/erl_bif_types.erl,v
retrieving revision 1.263
diff -u -r1.263 erl_bif_types.erl
--- lib/hipe/cerl/erl_bif_types.erl     16 Feb 2010 13:56:50 -0000 
1.263
+++ lib/hipe/cerl/erl_bif_types.erl     20 Mar 2010 06:11:45 -0000
@@ -4534,7 +4534,7 @@
          t_tuple([t_atom('line_length'), t_non_neg_integer()])]).

  t_decode_packet_type() ->
-  t_sup(t_inet_setoption_packettype(), t_atom('httph')).
+  t_sup([t_inet_setoption_packettype(), t_atom('httph'), 
t_atom('httph_bin')]).

  t_dist_exit() ->
    t_sup([t_atom('kill'), t_atom('noconnection'), t_atom('normal')]).


More information about the erlang-questions mailing list