[erlang-questions] -callback directives with Dialyzer
Tue Sep 15 19:39:00 CEST 2015
This was done with Erlang R15B02.
The example code and problem can also be seen here:
Based on everything I've been reading and looking at, it seemed like if I
have a behavior like this...
-callback hey_dude(Say :: string()) -> Res :: string().
And I then implement it...
lists:flatten(io_lib:format("Hey Dude, ~p", [Say])).
And finally, I try to use it...
-spec run() -> ok.
If i run dialyzer with these 3 files, It should complain about a contract
violation right? Except I'm running into the problem of that its not. I
created a sample repo with the output of dialyzer here:
https://github.com/Ceryni/cuddly-octo-adventure. If I explicitly define
`-spec` then it works as expected and barks at me for using an integer
instead of a string, but I thought dialyzer would use the -callback? Any
thoughts on what I'm doing wrong here? Maybe using dialyzer incorrectly? My
Erlang SDK is too old? Just trying to figure out what's going on.
Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions