[erlang-questions] 12B4 dialyzer problem 4

Anthony Shipman <>
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 ->

(285)  TRef ->
	State#state{timer = undefined}

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 
                   grow up to be outsourced.

More information about the erlang-questions mailing list