dialyzer bug?

Samuel Rivas <>
Thu Apr 14 10:49:51 CEST 2005


Hi,

Next code makes dialyzer to output an error:

-module(test).
-export([test/1]).

test(Foo) ->
        Foo/bar.

When dialyzer (v1.3.0) tries to analyse it the next error rises:

<HiPE (v 3.4.0)> Error: [hipe:781]: ERROR: {function_clause,
                                               [{hipe_icode_type,
                                                    find_signature_mfa,
                                                    ['/']},
                                                {hipe_icode_type,
                                                    find_plt_return,
                                                    2},
                                                {hipe_icode_type,
                                                    check_for_tuple_as_fun,
                                                    2},
                                                {hipe_icode_type,
                                                    warn_on_call_1,
                                                    3},
                                                {hipe_icode_type,
                                                    warn_on_call,
                                                    4},
                                                {hipe_icode_type,
                                                    warn_on_instr,
                                                    3},
                                                {hipe_icode_type,warn_on_bb,3},
                                                {hipe_icode_type,
                                                    warn_on_type_errors,
                                                    5}]}

I found this error in a bigger project (a confusion with bit syntax led
me to write Something = Stuff/binary), the behaviour was slightly
different when dialyzer tried to read the wrong code within the whole
project analysis, it showed the error in the warning window, in the test
case the error is shown in a separate window. Sadly I wasn't able to
write a synthetic test that achieves the same result :(

Aside, experimenting with the compiler I found out that expressions like 
a/b, a+b, ... generate a warning, but expressions like A/b don't. I
suppose it would be wise to warn in all these cases.

Regards
-- 
	Samuel



More information about the erlang-questions mailing list