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

      if declaration.type and declaration.type not instanceof TempType
        throw new Error "assignType: #{name} already has a type"
      declaration.type = type
    else
      throw new Error "assignType: #{name} is not declared"

  currentDeclarations: ->
    cloneMap @_scope()

  addToDeferredNames: (binding) ->
    @_deferrableDefinition().deferredBindings.push binding

  addToDeferred: (binding) ->
    @_scope().deferredBindings.push binding

  addToDefinedNames: (binding) ->
    @_currentDefinition()?.definedNames?.push binding

  definedNames: ->
    @_currentDefinition()?.definedNames ? []

  deferredNames: ->
    @_definition().deferredBindings

  deferredBindings: ->
    @_scope().deferredBindings

  declareArity: (name, arity) ->
    @declare name, arity: arity

      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
