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:    * a string.
     */
    String formatType(EntityRef entityRef) {
      if (entityRef.implicitFunctionTypeIndices.isNotEmpty ||
          entityRef.syntheticParams.isNotEmpty ||
          entityRef.syntheticReturnType != null) {
        // TODO(paulberry): fix these cases.
        return 'BAD(${JSON.encode(entityRef.toJson())})';
      }
      if (entityRef.paramReference != 0) {
        return typeParamsInScope[
  
negative.code:       case ReferenceKind.function:
        case ReferenceKind.propertyAccessor:
        case ReferenceKind.topLevelFunction:
        case ReferenceKind.method:
        case ReferenceKind.typedef:
        case ReferenceKind.prefix:
        case ReferenceKind.topLevelPropertyAccessor:
          break;
        default:
          // TODO(paulberry): fix this case.
  