Dialyzer warnings for gen_stream

Björn Gustavsson bgustavsson@REDACTED
Mon May 31 09:57:44 CEST 2010


./gen_stream.erl:305: gen_stream.erl:305: Invalid type specification
for function gen_stream:init/1. The success typing is
(#gstr_state{mod_state::'ignore' | 'undefined' | {'ok',_} | {'stop',_}
| {'ok',_,_}}) -> 'ignore' |
{'ok',#gstr_state{stream_type::'undefined' | {'behaviour',atom()} |
{'binary',binary()} |
{'file',[any()]},options::#gstr_opts{x_mfa::'undefined' |
{_,_}},procs::{pid()}}} | {'stop',_} |
{'ok',#gstr_state{stream_type::'undefined' | {'behaviour',atom()} |
{'binary',binary()} |
{'file',[any()]},options::#gstr_opts{x_mfa::'undefined' |
{_,_}},procs::{pid()}},_}

./gen_stream.erl:351: gen_stream.erl:351: The specification for
gen_stream:handle_call/3 states that the function might also return
{'stop','normal',{'gstr_state','undefined' | {'behaviour',atom()} |
{'binary',binary()} | {'file',string()},_,'end_of_stream' |
{pid()},_,non_neg_integer(),atom() | non_neg_integer(),atom() |
non_neg_integer(),_}} but the inferred return is
{'reply',{'next_block',_} | {'pct_complete',atom() | integer()} |
{'stream_pos',_} | {'stream_size',atom() | non_neg_integer()} |
{'unknown_request',_},_} | {'stop','normal','stopped',_}

./gen_stream.erl:439: gen_stream.erl:439: The pattern <Reason,
{'gstr_state', {'behaviour', Module, _ModArgs}, _, Procs, ModState, _,
_, _, _}> can never match the type <_,_>

./gen_stream.erl:462: gen_stream.erl:462: The pattern <OldVsn, State =
{'gstr_state', {'behaviour', Module, _ModArgs}, _, _, ModState, _, _,
_, _}, Extra> can never match the type <_,_,_>

./gen_stream.erl:596: gen_stream.erl:596: The pattern <{'behaviour',
Module, _ModInitArgs}, Seen, Chunk> can never match the type
<'undefined' | {'behaviour',atom()} | {'binary',binary()} |
{'file',string()},_,_>

./gen_stream.erl:627: gen_stream.erl:627: The pattern <Args =
{'gstr_args', {'behaviour', Module, _InitArgs}, SrcSize, _, _, _, _,
BlockSize, _, IsCircular, _, ModState}, ProcNums> can never match the
type <#gstr_args{stream_type::'undefined' |
{'behaviour',atom()},source_size::atom() |
non_neg_integer()},[integer()]>

./gen_stream.erl:631: gen_stream.erl:631: Function will never be called


-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB


More information about the erlang-patches mailing list