[erlang-questions] possible dialyzer bug

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Mon Jan 25 16:06:38 CET 2016


On Mon, Jan 25, 2016 at 3:09 PM, Zachary Kessin <zkessin@REDACTED> wrote:

> I have a strange dialyzer problem, I have this code
>

You would have to supply the convert_map_to_record function as well.
Usually the case is that the dialyzer has figured out, one way or the
other, that there is only a single possible outcome of
convert_map_to_record: {error, _}. Hence it reports that {ok, MR} can never
match, which is true.

This commonly happens when you have a planned extension later in the code
base, and have provided scaffolding for the extension, yet the underlying
code is not able to touch that newly formed code path yet because it
doesn't return the correct type of value.

Another common case is where there is another error somewhere in your code
and the dialyzer has figured out that with the current constraints,
convert_map_to_record can only succeed without crashing by returning
{error, _}.  This can happen if the record spec is not precise enough, for
instance.



-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160125/e3b6540f/attachment.htm>


More information about the erlang-questions mailing list