       @types[declaration.id] = type
     else
       throw new Error "assignType: #{name} is not declared"
-
 
   assignArity: (name, arity) ->
     (@_declarationInCurrentScope name).arity = arity

      # log "adding top level lhs to deferred #{name}", deps
      currentType = type#substitute ctx.substitution, type
      ctx.addToDeferredBindings
        name: name
        scopeIndex: ctx.currentScopeIndex()
        type: currentType
        constraints: constraints

        contextType instanceof TempType
      # Typing deferred, use an impricise type var
      type = toConstrained ctx.freshTypeVariable star
      ctx.addToDeferredNames
        name: scopedName symbol, ctx.scopeIndexOfDeclaration symbol
        id: symbol
        type: (mapOrigin type, atom)
        scopeIndex: ctx.currentScopeIndex()
      nameTranslate ctx, atom, symbol, type
    else
      # log "deferring in rhs for #{symbol}", ctx._deferrableDefinition().name
      ctx.doDefer atom, symbol
      translation: deferredExpression()

scopedName = (name, scopeIndex) ->
  "#{name}_#{scopeIndex}"

constPattern = (ctx, symbol) ->
  exp = ctx.assignTo()
