[erlang-questions] Dialyzer generating spurious warnings when using the ?assert macro

Richard Evans richardprideauxevans@REDACTED
Tue Apr 19 17:37:19 CEST 2011


Hi guys,

I am going through adding typing to my functions and getting dialyzer to
verify everything, which is all working very nicely, apart from one minor
grievance:

There are two places where I use the ?assert macro, and I believe dialyzer
is giving me spurious warnings on these lines:

    interpretAction({implies, A, C, true}) ->
?assert(xl_string:impliesString(A,C));

    interpretAction({implies, A, C, false}) -> ?assert(not
xl_string:impliesString(A,C));

These generate the warnings:

    xl.erl:286: The variable _ can never match since previous clauses
completely covered the type 'false'
    xl.erl:287: The variable _ can never match since previous clauses
completely covered the type 'false'

I think these are problems with the macro and not with my code. Does anybody
have any info on this?

I also found this post on the internet, where somebody else seems to have a
similar problem:

http://erlang.2086793.n4.nabble.com/Eunit-assert-causes-Dialyzer-warning-td2252010.html

Any help much appreciated

thanks,
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110419/e301b3bc/attachment.htm>


More information about the erlang-questions mailing list