[erlang-questions] 12B4 dialyzer problem 4

Anthony Shipman als@REDACTED
Thu Sep 11 12:22:44 CEST 2008


I have some functions in a gen_server:


enableConnecting(State, T) ->
    {ok, TRef} = timer:send_after(T, State#state.timerRef),
    State#state{timer = TRef}.


disableConnecting(State) ->
    case State#state.timer of
    undefined ->
	State;

(285)  TRef ->
	timer:cancel(TRef),
	State#state{timer = undefined}
    end.

Dialyzer says

muConnector.erl:285: The variable TRef can never match since previous clauses 
completely covered the type 'undefined'

enableConnecting() is definitely reachable so how can this be so?  

-- 
Anthony Shipman                    Mamas don't let your babies 
als@REDACTED                   grow up to be outsourced.



More information about the erlang-questions mailing list