Dialyzer bug with 'not (boolexpr)' guard
Per Hedeland
per@REDACTED
Thu Feb 11 11:05:01 CET 2010
Hi,
I believe the code below demonstrates a bug in dialyzer (2.1.0) - it
produces the warning:
diabug.erl:19: Clause guard cannot succeed. The variable Cs was matched against the type any()
for the first test/1 clause, but of course the claim can easily be
refuted by calling test/0. (The other 2 test/1 clauses are just there to
narrow down the bug.)
Thanks
--Per Hedeland
------
-module(diabug).
-compile(export_all).
-record(cs, {
children = [],
actions = []
}).
-define(is_internal(X), ((X#cs.children /= []) or
(X#cs.actions /= []))).
-define(has_children(X), (X#cs.children /= [])).
test() ->
test(#cs{}).
test(Cs) when not ?is_internal(Cs) -> foo;
test(Cs) when not ?has_children(Cs) -> bar;
test(Cs) when ?is_internal(Cs) -> baz.
------
More information about the erlang-questions
mailing list