     @scopes = [topScope]
     @savedScopes = []
     @classParams = newMap()
+    @types = []
     @isMalformed = no
 
   macros: ->

    # log symbol, contextType
    if contextType and contextType not instanceof TempType
      type = freshInstance ctx, contextType
      {
        id: ctx.declarationId symbol
        type: type
        translation: nameTranslate ctx, atom, symbol, type, ctx.arity symbol
      }
    # Inside function only defer compilation if we don't know arity
    else if ctx.isInsideLateScope() and (ctx.isDeclared symbol) or contextType instanceof TempType
      # Typing deferred, use an impricise type var
      type = toConstrained ctx.freshTypeVariable star
      ctx.addToDeferredNames {name: symbol, type: type}
      {
        id: ctx.declarationId symbol
        type: type
        translation: nameTranslate ctx, atom, symbol, type, ctx.arity symbol
      }
    else
      # log "deferring in rhs for #{symbol}"
      ctx.doDefer atom, symbol

      translateIr ctx, op
  (jsCall op, (join classParams, (translateIr ctx, args)))

addConstraintsFrom = (ctx, {id, type}, to) ->
  typed = ctx.typeForId id
  if typed and (_empty to.constraints) and _notEmpty typed.type.constraints
    inferredType = freshInstance ctx, typed
    sub = matchType inferredType.type, (substitute ctx.substitution, type).type
