[erlang-bugs] dialyzer bug

Tobias Lindahl Tobias.Lindahl@REDACTED
Tue Sep 5 09:38:09 CEST 2006


I've got this kind of bug reported before, but unfortunately it is not
an easy one to fix. I have fixed in my development version and it will
make an otp patch release somewhere in the reasonably near future.

In the mean time, might I suggest that you make the self-recursive
function a named function that can make a ordinary tail call to itself.
It might be interesting to name this function to tell the world what it
is up to. If nothing else you will make Dialyzer give you the slightly
more interesting report that the function never returns.

Tobias


Martin Bjorklund wrote:
> When I check this module with dialyzer:
> 
> -module(a).
> -export([a/0]).
> 
> a() ->
>     F = fun(F, WaitTime) ->
>                 receive after WaitTime -> ok end,
>                 F(F, 3000)
>         end,
>     F(F, 1000).
> 
> I get:
> 
> {a,'-a/0-fun-0-',2}: Trying to use fun with type ((((none(),none()) -> none()),1000 | 3000) -> none()) with arguments (((((none(),none()) -> none()),1000 | 3000) -> none()),3000)!
> 
> 
> /martin
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-bugs




More information about the erlang-bugs mailing list