anchor.diff:      ElementDeclarationResult result;
       try {
         result = await _resolvedClassResult(
  -          resolver, indexedAnnotation.element, toString());
  +        resolver,
  +        indexedAnnotation.element,
  +        toString(),
  +      );
       } on BuildError catch (buildError) {
         return buildError;
       }
   
  -    var resolvedMetadata =
  -        _metadataWithWorkaround(result.node, indexedAnnotation.element);
  +    var resolvedMetadata = _metadataFromAncestry(result.node);
   
       if (resolvedMetadata == null) {
         return BuildError.forElement(indexedAnnotation.element, toString());
  
positive.code:   return _metadataFromAncestry(node.parent);
  }
  
  List<Annotation> _metadataWithWorkaround(
      AstNode node, Element originalElement) {
    var resolvedMetadata = _metadataFromAncestry(node);
  
    // TODO(b/124524319): Remove this check when the Analyzer is fixed.
    if (resolvedMetadata.isEmpty &&
        originalElement is ParameterElement &&
        node is ConstructorDeclaration) {
      return null;
    }
    return resolvedMetadata;
  }
  
  class ErrorMessageForAnnotation extends AsyncBuildError {
    final IndexedAnnotation indexedAnnotation;
  
  
negative.code:       );
      }
  
      var resolvedMetadata = _metadataFromAncestry(result.node);
  
      if (resolvedMetadata == null) {
        return BuildError.forElement(indexedAnnotation.element, toString());
  