 
   # Properly bind types according to the pattern
   if pattern.tea
-    # log "pattern", matched.tea, pattern.tea
     unify ctx, matched.tea.type, pattern.tea.type
 
   constraints = matched.tea.constraints

          ctx.assignArity name, paramNames
        else
          documentation = extractDocs docs
          ctx.preDeclare name,
            arity: paramNames
            id: ctx.definitionId()
            type: ctx.preDeclaredType name # if any
            docs: documentation

      newParamType = (param) ->
        param.scope = ctx.currentScopeIndex()

    to = ctx.definitionPattern()
    ctx.setAssignTo (irDefinition expression.tea, translatedExpression,
      {name: ctx.definitionName(), scopeIndex: ctx.currentScopeIndex()})
    {precs, assigns, isMalformed} = patternCompile ctx, to, expression, polymorphic
    translationCache = ctx.resetAssignTo()

    #log "ASSIGN #{ctx.definitionName()}", ctx.shouldDefer()
