Getting typer to work for me

Torben Hoffmann torben.lehoff@REDACTED
Tue Dec 15 09:52:27 CET 2009


I have the following code:



-spec fup(integer()) -> {'ok',integer()} | 'wrong'.

fup(1) ->
fup(_) ->

And I sort of expected that typer would find the problem in the fup(_) case,
but I have to use
dialyzer -Wspecdiffs --src ups.erl
in order to get the warning I want (namely that the code does not match the
spec), but the dialyzer docs warns against using this option.

Am I asking too much? Should I shake off more of my SML heritage? Am I doing
something wrong?

Any advice appreciated!


More information about the erlang-questions mailing list