 
 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?

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

printType = (type) ->
  if type.TypeVariable

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