anchor.diff:            EntityRef ref = uc.references[refPtr++];
             _ReferenceInfo info = resynthesizer.referenceInfos[ref.reference];
             if (info.element != null) {
  -            Identifier node = _buildElementAst(info.name, info.element);
  -            _push(node);
  -          } else if (info.type != null) {
  -            Identifier node = _buildElementAst(info.name, info.type.element);
  +            SimpleIdentifier node = AstFactory.identifier3(info.name);
  +            node.staticElement = info.element;
               _push(node);
             } else {
               throw new StateError('Unsupported reference ${ref.toMap()}');
  
positive.code:       }
      }
      return stack.single;
    }
  
    Identifier _buildElementAst(String name, Element element) {
      SimpleIdentifier node = AstFactory.identifier3(name);
      node.staticElement = element;
      return node;
    }
  
    TypeName _buildTypeAst(DartType type) {
  
negative.code:         name = linkedUnit.references[i].name;
          containingReference = linkedUnit.references[i].containingReference;
        }
        Element element;
        DartType type;
        if (linkedReference.kind == ReferenceKind.unresolved) {
          type = summaryResynthesizer.typeProvider.undefinedType;
          element = type.element;
        } else if (name == 'dynamic') {
          type = summaryResynthesizer.typeProvider.dynamicType;
          element = type.element;
        } else if (name == 'void') {
          type = VoidTypeImpl.instance;
          element = type.element;
        } else {
          List<String> locationComponents;
          if (containingReference != 0 &&
  