 
 finalizeTypes = (ctx, ast) ->
   visitExpressions ast, (expression) ->
-    if expression.tea
+    if expression?.label is 'name' and (type = ctx.actualType expression.symbol)
+      expression.tea = type
+    else if expression.tea
       expression.tea = substitute ctx.substitution, expression.tea
     return
   for scope in ctx.savedScopes when scope?

  else if type.TypeApp
    concatMaps (findFree type.op), (findFree type.arg)
  else if type.Constrained
    concatMaps (findFreeInList type.constraints), (findFree type.type)
  else if type.ClassConstraint
    findFree type.types
  else if type.Types

    prettyPrint type.type
  else if type.Constrained
    if _notEmpty type.constraints
      (map highlightType, join [type.type], type.constraints).join ' '
    else
      highlightType type.type

printType = (type) ->
  if type.TypeVariable
