Zachary K
Zachary K

Reputation: 3345

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.

Upvotes: 4

Views: 718

Answers (1)

Ward Bekker
Ward Bekker

Reputation: 6366

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

Upvotes: 8

Related Questions