     "i#{@variableIndex++}"
 
   doDefer: (expression, dependencyName) ->
-    @_setDeferIn @_deferrableDefinition(), expression, dependencyName
-
-  _setDeferIn: (definition, expression, dependencyName) ->
+    definition = @_deferrableDefinition()
     definition._defer =
-      (@_deferReasonOf definition) or [expression, dependencyName]
+      (@_deferReasonOf definition) or [expression, dependencyName, @currentScopeIndex()]
 
   deferReason: ->
     @_deferReasonOf @_deferrableDefinition()

    if deps.length > 0
      # log "adding top level lhs to deferred #{name}", deps
      currentType = type#substitute ctx.substitution, type
      ctx.addToDeferred
        name: name
        scopeIndex: ctx.currentScopeIndex()
        type: currentType

    deferredCount = 0
    while (_notEmpty ctx.deferred()) and deferredCount < ctx.deferred().length
      prevSize = ctx.deferred().length
      [expression, dependencyName, useScope, lhs, rhs] = deferred = ctx.deferred().shift()
      if useScope isnt ctx.currentScopeIndex() and (ctx.isDeclared dependencyName) or
          (ctx.isFinallyDeclared dependencyName)
        compiledPairs.push definitionPairCompile ctx, lhs, rhs
        deferredCount = 0
      else
