|
|
| Author |
Message |
|
| Guest |
Posted: Mon Sep 04, 2006 11:09 am |
|
|
|
Guest
|
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@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-bugs
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Tue Sep 05, 2006 7:43 am |
|
|
|
Guest
|
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@erlang.org
> http://www.erlang.org/mailman/listinfo/erlang-bugs
_______________________________________________
erlang-bugs mailing list
erlang-bugs@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-bugs
Post recived from mailinglist |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|