[erlang-questions] Dialyzer bugs help

Sean Cribbs seancribbs@REDACTED
Thu Jan 2 22:49:51 CET 2014


Thanks Anthony!

Kostis replied to me privately and we found what you did -- unused
functions get none() type parameters because there's no type to infer. Not
sure if this is a Dialyzer bug (the function had a spec!), or just a
fact-of-life.  This basically raised the fact I had been hacking around
tracking which combinators were used/unused in the generated parser by
injecting a -compile({nowarn_unused_function, [...]}) attribute into the
generated code. Shame on me! I've rectified the issue for now using macros.

The other errors are more trivial.


On Thu, Jan 2, 2014 at 3:19 PM, Anthony Ramine <n.oxyde@REDACTED> wrote:

> Hello again Sean, hello Kostis,
>
> There is something in Dialyzer that makes it say weird stuff about unused
> unexported functions.
>
> -module(t).
>
> -compile({nowarn_unused_function,[p_assert/1]}).
>
> -ifdef(EXPORT).
> -export([p_assert/1]).
> -endif.
>
> p_assert(P) ->
>     fun(Input,Index) ->
>         case P(Input,Index) of
>             {fail,_} = Failure -> Failure;
>             _ -> {[], Input, Index}
>         end
>     end.
>
> If compiled with -DEXPORT, Dialyzer stays silent; if compiled without,
> Dialyzer yells.
>
> Interestingly enough, it also unexpectedly yells if compiled with
> +export_all.
>
> Regards,
>
> --
> Anthony Ramine
>
> Le 2 janv. 2014 à 22:09, Anthony Ramine <n.oxyde@REDACTED> a écrit :
>
> > Still fighting these two.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140102/4467f845/attachment.htm>


More information about the erlang-questions mailing list