anchor.diff:        assert(name.isEmpty);
         result += 'localFunction[${linkedRef.localIndex}]';
       }
  -    if (!typeOf || linkedRef.kind == ReferenceKind.classOrEnum) {
  +    if (!typeOf ||
  +        linkedRef.kind == ReferenceKind.classOrEnum ||
  +        linkedRef.kind == ReferenceKind.typedef) {
         return result;
       } else {
         return 'typeof($result)';
  
positive.code:       case ReferenceKind.function:
        case ReferenceKind.propertyAccessor:
        case ReferenceKind.topLevelFunction:
          break;
        default:
          // TODO(paulberry): fix this case.
  
negative.code:     String result = formatReference(entityRef.reference, typeOf: true);
      if (entityRef.typeArguments.isNotEmpty) {
        result += '<${entityRef.typeArguments.map(formatType).join(', ')}>';
      }
      if (implicitFunctionTypeIndices.isNotEmpty) {
        result =
            'parameterOf($result, ${implicitFunctionTypeIndices.join(', ')})';
      }
      return result;
    }
  