anchor.diff:  
     void compareElementAnnotations(ElementAnnotationImpl resynthesized,
         ElementAnnotationImpl original, String desc) {
  -    expect(resynthesized.element, isNotNull, reason: desc);
  -    expect(resynthesized.element.kind, original.element.kind, reason: desc);
  -    expect(resynthesized.element.location, original.element.location,
  -        reason: desc);
  +    if (original.element == null) {
  +      expect(resynthesized.element, isNull);
  +    } else {
  +      expect(resynthesized.element, isNotNull, reason: desc);
  +      expect(resynthesized.element.kind, original.element.kind, reason: desc);
  +      expect(resynthesized.element.location, original.element.location,
  +          reason: desc);
  +    }
       expect(resynthesized.compilationUnit, isNotNull, reason: desc);
       expect(resynthesized.compilationUnit.location,
           original.compilationUnit.location,
  
positive.code:     checkLibrary('f() {} g() {}');
    }
  
    test_unresolved_export() {
      allowMissingFiles = true;
      checkLibrary("export 'foo.dart';", allowErrors: true);
  
negative.code:         compareConstAstLists(
              r.arguments?.arguments, o.arguments?.arguments, desc);
          Element expectedElement = o.element;
          if (oName is PrefixedIdentifier &&
              o.constructorName != null &&
              o.element != null) {
            // Due to dartbug.com/25706, [o.element] incorrectly points to the
            // class rather than the named constructor.  Hack around this.
            // TODO(paulberry): when dartbug.com/25706 is fixed, remove this.
  