anchor.diff:     * 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())})';
  +    List<int> implicitFunctionTypeIndices =
  +        entityRef.implicitFunctionTypeIndices;
  +    if (entityRef.syntheticReturnType != null) {
  +      String params = entityRef.syntheticParams.map(formatParam).join(', ');
  +      String retType = formatType(entityRef.syntheticReturnType);
  +      return '($params) -> $retType';
       }
       if (entityRef.paramReference != 0) {
         return typeParamsInScope[
  
positive.code:     String result = formatReference(entityRef.reference, typeOf: true);
      if (entityRef.typeArguments.isNotEmpty) {
        result += '<${entityRef.typeArguments.map(formatType).join(', ')}>';
      }
      return result;
    }
  
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.
  