jeremyjh / dialyxir

Mix tasks to simplify use of Dialyzer in Elixir projects.
Apache License 2.0
1.69k stars 141 forks source link

Legacy warning #466

Closed saleynik closed 8 months ago

saleynik commented 2 years ago

Environment

Erlang/OTP 25 Elixir 1.13.2

1.2.0

Current behavior

mix dialyzer reports:

Please file a bug in https://github.com/jeremyjh/dialyxir/issues with this message.

Unknown error occurred: %Protocol.UndefinedError{description: "", protocol: String.Chars, value: {74, 30}}

Legacy warning:
src/fx.erl:74:30: Unknown type util:success_decode/0

Line fx.erl:74:

-spec decode(nif|native, binary(), nif:decode_options()) ->
        {ok, Rest::binary(), util:success_decode()}
        | {more, non_neg_integer()}
        | {error, any()}
        | no_return().

util.erl is accessible to dialyzer, and has this:

-type success_decode() ::
  {MatchedFldCount::integer(), Header::map(),
    {MsgType::atom(),Msg::map()}, UnparsedFields::list()}.

Expected behavior

Dialyzer should not produce no warning. Also note that when the same project is analyzed with rebar3 dialyzer there are no warnings produced.