[erlang-patches] Dialyzer warnings for gen_stream
Kostis Sagonas
kostis@REDACTED
Mon May 31 13:43:52 CEST 2010
Björn Gustavsson wrote:
> 2010/5/31 Kostis Sagonas <kostis@REDACTED>:
>
>> These dialyzer warnings are correct but some of them look a bit weird.
>
> It is dialyzer run based on the 'pu' branch, using an escript
> that formats the warnings as HTML code.
Bjorn,
The problem is that the warnings as output by the escript do not make
much sense. For example, the warning:
./gen_stream.erl:439: gen_stream.erl:439: The pattern <Reason,
{'gstr_state', {'behaviour', Module, _ModArgs}, _, Procs, ModState, _,
_, _, _}> can never match the type <_,_>
is problematic because the type contains two underscores, i.e. two any()
Instead, the vanilla dialyzer specifies some type which indeed does not
match the pattern:
gen_stream.erl:439: The pattern <Reason, {'gstr_state', {'behaviour',
Module, _ModArgs}, _, Procs, ModState, _, _, _, _}> can never match the
type <_,#gstr_state{stream_type::'undefined' | {'behaviour',atom()} |
{'binary',binary()} | {'file',string()},procs::'end_of_stream' |
{pid()},active_proc::non_neg_integer(),source_size::atom() |
non_neg_integer(),report_size::atom() | non_neg_integer()}>
the stream_type is {'behaviour',Module,_ModArgs} while the type
declaration of the #gstr_state{} record reads: {'behaviour',atom()}
(among others).
So, either the dialyzer in 'pu' or the escript needs fixing here.
Kostis
More information about the erlang-patches
mailing list