anchor.diff:            constantEvaluationErrors, indexedAnnotation.element));
       }
   
  -    var libraryElement = indexedAnnotation.element.library;
  -    var libraryResult = await ResolvedLibraryResultImpl.tmp(libraryElement);
  -    if (libraryResult.state == ResultState.NOT_A_FILE) {
  -      // We don't have access to source information in summarized libraries,
  -      // but another build step will likely emit the root cause errors.
  -      return BuildError("Analysis errors in summarized library "
  -          "${libraryElement.source.fullName}");
  -    }
  -
  -    var classResult =
  -        libraryResult.getElementDeclaration(indexedAnnotation.element);
  +    ElementDeclarationResult classResult;
  +    try {
  +      classResult = await _resolvedClassResult(indexedAnnotation.element);
  +    } on BuildError catch (buildError) {
  +      return buildError;
  +    }
  +
       var classDeclaration = classResult.node as ClassDeclaration;
       var resolvedAnnotation =
           classDeclaration.metadata[indexedAnnotation.annotationIndex];
  
positive.code: 
    @override
    Future<BuildError> resolve() async {
      final element = indexedAnnotation.element;
      final annotationIndex = indexedAnnotation.annotationIndex;
  
      var libraryResult = await ResolvedLibraryResultImpl.tmp(element.library);
      var result = libraryResult.getElementDeclaration(element);
      List<Annotation> resolvedMetadata = _metadataFromAncestry(result.node);
  
      ElementAnnotation resolvedAnnotation =
  
negative.code:     throw BuildError(
          buildErrors.map((buildError) => buildError.message).join("\n\n"));
    }
  }
  
  Future<ElementDeclarationResult> _resolvedClassResult(Element element) async {
    var libraryElement = element.library;
    var libraryResult = await ResolvedLibraryResultImpl.tmp(libraryElement);
    if (libraryResult.state == ResultState.NOT_A_FILE) {
      // We don't have access to source information in summarized libraries,
      // but another build step will likely emit the root cause errors.
      throw BuildError("Analysis errors in summarized library "
          "${libraryElement.source.fullName}");
    }
    return libraryResult.getElementDeclaration(element);
  }
  
  class AsyncBuildError extends BuildError {
  