       catch e
         throw new Error "Error when deferring #{name} #{e.message}"
       if _notEmpty retainedConstraints
-        ctx.extendSubstitution substituionFail "#{name}'s context is too weak, missing #{listOf (map printType, retainedConstraints)}"
+        ctx.extendSubstitution substitutionFail "#{name}'s context is too weak, missing #{listOf (map printType, retainedConstraints)}"
   else
     # log name, "constraints", (substituteList ctx.substitution, constraints)
     [deferredConstraints, retainedConstraints] = deferConstraints ctx,

    currentType = substitute ctx.substitution, type
    # log "assign type", name, (printType (addConstraints currentType, retainedConstraints)), (printType quantifyUnbound ctx, (addConstraints currentType, retainedConstraints))
    if includesJsType currentType.type
      ctx.extendSubstitution substituionFail "#{name}'s inferred type includes JS"
    else
      ctx.assignType name,
        if polymorphic

  # log "is deferriing", (print pattern), ctx.shouldDefer()
  # Make sure deferred names are added to scope so they are compiled within functions
  if ctx.shouldDefer()
    shouldDeclareFinally = ctx.isDeclared ctx.deferReason()[1]
    for {name, id} in definedNames
      if not ctx.isCurrentlyDeclared name
        if shouldDeclareFinally
          ctx.declare name, id: id
        else
          ctx.preDeclare name, id: id
    #log "exiting pattern early", pattern, "for", ctx.shouldDefer()
    return {}

