[erlang-questions] Somebody please correct my -callback understanding

Damian Dobroczyński qoocku@REDACTED
Wed Dec 14 17:58:23 CET 2011

Hi list!

I have a module "a" defining callback "c":

-module (a).
-callback c (integer()) -> integer().

Now, I have callback module "b" implementing invalid (non-comforming the
a:c/1 spec) callback "c":

-module (b).
-behavior (a).
-export ([c/1]).

c (A) when is_atom(A) ->

Now, I dialyze both modules:

$ dialyze -n --src a.erl b.erl

which outputs:

  Proceeding with analysis... done in 0m0.64s
done (passed successfully)

What I've expected is the dialyzer warning about invalid b:c/1 function
(something about breaking the contract for c/1). Am I right?

-- D.

More information about the erlang-questions mailing list