[erlang-bugs] Dialyzer error on supervisor:init spec in R15

Stavros Aronis aronisstav@REDACTED
Tue Mar 6 10:01:45 CET 2012


Hi Jay,

the warning does look hairy but is, nevertheless, valid. {tuple(), [any()]}
is not a subtype of the expected specification (interpret this as "at least
as strict as"). If you would like to use a generic specification that would
still keep Dialyzer happy you should instead write:

-spec init(Args::{}) ->
{ok,{{supervisor:restart_strategy(),MaxR::non_neg_integer(),MaxT::non_neg_integer()},[supervisor:child_spec()]}}.

Unfortunately this will still give an error in R15B, because of a real bug
in Dialyzer. A patch for this has been already submitted and will soon be
available in the maint branch of erlang/otp.

Regards,
Stavros

On Tue, Mar 6, 2012 at 6:29 AM, Jay Nelson <jay@REDACTED> wrote:

> [...]
>
> This problem can be recreated with a simple supervisor:init spec, pasted
> into any handy supervisor:init you have laying around:
>
> -spec init(Args::{}) -> {ok, {tuple(), list()}}.
>
> When I try it with R14B03, there are no errors.
> On R15B I get the above error.
>
> jay
>
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20120306/021c451b/attachment.htm>


More information about the erlang-bugs mailing list