   if ctx.shouldDefer()
     shouldDeclareFinally = ctx.isDeclared ctx.deferReason()[1]
     for {name, id} in definedNames
-      if not ctx.isCurrentlyDeclared name
+      if not ctx.isFinallyCurrentlyDeclared name
         if shouldDeclareFinally
           ctx.declare name, id: id
         else

          [[(validIdentifier symbol), exp]]
  else
    # Name typed, use a fresh instance
    # log symbol, contextType
    if contextType and contextType not instanceof TempType
      type = freshInstance ctx, contextType
      nameTranslate ctx, atom, symbol, type
    # In sub-scope (function) only defer compilation for declarations in current scope
    else if (not ctx.isCurrentlyDeclared symbol) and
        (ctx.isFinallyDeclared symbol) or contextType instanceof TempType
      # Typing deferred, use an impricise type var
      type = toConstrained ctx.freshTypeVariable star
      ctx.addToDeferredNames {name: symbol, type: type}

    (def = @scopes[i].definition) and def.deferrable and def or
      i > 0 and (@_deferrableDefinitionAtScope i - 1) or undefined

  parentDeferrableDefinitionNames: ->
    @_parentDeferrableDefinitionNames @scopes.length - 1

  _parentDeferrableDefinitionNames: (i) ->
    rest =
      if i > 0
        @_parentDeferrableDefinitionNames i - 1
      else
        []
    if (def = @scopes[i].definition) and def.deferrable and def.name
      join [def.name], rest
    else
      rest

  isDefining: ->
    !!@_scope().definition

