[erlang-questions] -callback directives with Dialyzer

Kostis Sagonas <>
Tue Sep 15 20:06:06 CEST 2015


On 09/15/2015 07:39 PM, Matthew Fitzpatrick wrote:
>
> If i run dialyzer with these 3 files, It should complain about a
> contract violation right?

Well, not so clear...

First of all, dialyzer never promised to complain about contract 
violations; instead, all it promised is that when it does complain, it 
has every right to do so.

Second, the no_spec_dude module that defines the callback, defines a 
callback with success typing: hey_dude(any()) -> string() which does not 
violate the callback spec.  True, there is some other module that passes 
an integer() argument there, but this is not a violation of the 
definition of the callback function.

Kostis


More information about the erlang-questions mailing list