[erlang-questions] dialyzer and supervisor init/1 callback spec

Damian Dobroczyński qoocku@REDACTED
Wed Feb 29 15:56:51 CET 2012


Hi list!

I've managed to create spec for my custom supervisor init/1 function,
like this:

"""
-spec init (atom()) -> {ok, {{supervisor:strategy(),
                              non_neg_integer(),
                              non_neg_integer()},
                             [supervisor:child_spec()]}} | ignore.
"""

Dialyzer (R15B) complains:

"""
 The return type none() in the specification of init/1 is not a subtype
of 'ignore' | {'ok',{{'one_for_all',non_neg_integer(),non_neg_integer()}
| {'one_for_one',non_neg_integer(),non_neg_integer()} |
{'rest_for_one',non_neg_integer(),non_neg_integer()} |
{'simple_one_for_one',non_neg_integer(),non_neg_integer()},[{_,{atom() |
tuple(),atom(),'undefined' | [any()]},'permanent' | 'temporary' |
'transient','brutal_kill' | 'infinity' | non_neg_integer(),'supervisor'
| 'worker','dynamic' | [atom() | tuple()]}]}}, which is the expected
return type for the callback of supervisor behaviour
"""

I just want to make sure that's this bug is known or it's a feature not
a bug or my mind has rotten to such extent that I cannot see an obvious
mistake I made.

Somebody, please, may explain this?

-- D.





More information about the erlang-questions mailing list