Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having Dialyzer support Custom Behaviours

I am using Dialyzer with a few custom behaviors, the problem is that when I do that, Dialyzer gives me this error:

src/max.erl:3: Callback info about the gen_strategy behaviour is not available

One thing I can't figure out is how to create that callback info. I would like to add this information to my behaviour, so I can get that much more testing out of Dialyzer.

like image 813
Zachary K Avatar asked Feb 17 '23 04:02

Zachary K


1 Answers

Starting with R15B, The Erlang/OTP compiler was upgraded so that it now handles a new module attribute, named -callback.

Example:

-callback init(Args :: term()) ->
    {ok, State :: term()} | {ok, State :: term(), timeout() | hibernate} |
    {stop, Reason :: term()} | ignore.

More about that here and here

like image 62
Ward Bekker Avatar answered Feb 23 '23 05:02

Ward Bekker