[erlang-questions] Dialyzer

Carlo Bertoldi <>
Mon May 2 11:07:25 CEST 2011


Hello list,
  this is a bad monday, and I'm stuck with this warning from dialyzer:

The specification for change_interval/2 states that the function might 
also return [any()] but the inferred return is none()

The code:
-spec(change_interval(integer(), [term()]) -> [term()]).

change_interval(NewInterval, Config) ->
     NewPause = {pause, NewInterval},
     NewConfig = lists:keyreplace(pause, 1, Config, NewPause),
     write_config(NewPause),
     NewConfig.

Config is a list of terms, built using file:consult.
I googled a bit, and I understand that this is a common problem, but it 
really goes over my head.
What am I missing?

  Carlo





More information about the erlang-questions mailing list