anchor.diff:  
     ClassHierarchyBuilder(this.objectClass);
   
  -  Declaration handleOverride(KernelClassBuilder cls, Declaration member,
  -      Declaration superMember, MergeKind mergeKind) {
  -    if (member.next != null || superMember.next != null) {
  +  /// A merge conflict arises when merging two lists that each have an element
  +  /// with the same name.
  +  ///
  +  /// If [mergeKind] is `MergeKind.superclass`, [a] should override [b].
  +  ///
  +  /// If [mergeKind] is `MergeKind.interfaces`, we need to record them and
  +  /// solve the conflict later.
  +  ///
  +  /// If [mergeKind] is `MergeKind.supertypes`, [a] should implement [b], and
  +  /// [b] is implicitly abstract.
  +  Declaration handleMergeConflict(KernelClassBuilder cls, Declaration a,
  +      Declaration b, MergeKind mergeKind) {
  +    if (a == b) return a;
  +    if (a.next != null || b.next != null) {
         // Don't check overrides involving duplicated members.
  -      return member;
  -    }
  -    Member target = member.target;
  -    Member superTarget = superMember.target;
  -    if ((memberKind(target) ?? ProcedureKind.Getter) !=
  -        (memberKind(superTarget) ?? ProcedureKind.Getter)) {
  -      String name = member.fullNameForErrors;
  +      return a;
  +    }
  +    Member aTarget = a.target;
  +    Member bTarget = b.target;
  +    if ((memberKind(aTarget) ?? ProcedureKind.Getter) !=
  +        (memberKind(bTarget) ?? ProcedureKind.Getter)) {
  +      String name = a.fullNameForErrors;
         if (mergeKind == MergeKind.interfaces) {
           cls.addProblem(messageInheritedMembersConflict, cls.charOffset,
               cls.fullNameForErrors.length,
               context: <LocatedMessage>[
                 messageInheritedMembersConflictCause1.withLocation(
  -                  member.fileUri, member.charOffset, name.length),
  +                  a.fileUri, a.charOffset, name.length),
                 messageInheritedMembersConflictCause2.withLocation(
  -                  superMember.fileUri, superMember.charOffset, name.length),
  +                  b.fileUri, b.charOffset, name.length),
               ]);
         } else {
           cls.addProblem(messageDeclaredMemberConflictsWithInheritedMember,
  -            member.charOffset, name.length,
  +            a.charOffset, name.length,
               context: <LocatedMessage>[
                 messageDeclaredMemberConflictsWithInheritedMemberCause
  -                  .withLocation(
  -                      superMember.fileUri, superMember.charOffset, name.length)
  +                  .withLocation(b.fileUri, b.charOffset, name.length)
               ]);
         }
       }
  -    if (target.name == noSuchMethodName && !target.isAbstract) {
  +    if (aTarget.name == noSuchMethodName && !aTarget.isAbstract) {
         hasNoSuchMethod = true;
       }
  -    Declaration result = member;
  +    Declaration result = a;
       if (mergeKind == MergeKind.interfaces) {
  -      // TODO(ahe): Combine the signatures of member and superMember.
  -    } else if (target.isAbstract) {
  -      if (!superTarget.isAbstract) {
  +      // TODO(ahe): Combine the signatures of a and b.
  +    } else if (aTarget.isAbstract) {
  +      if (!bTarget.isAbstract) {
           // An abstract method doesn't override an implemention inherited from a
           // superclass.
  -        result = superMember;
  +        result = b;
         } else {
           abstractMemberCount++;
         }
  
positive.code:         scope = mixin.scope;
        }
      }
      List<Declaration> sortedLocals =
          new List<Declaration>.from(scope.local.values)
            ..sort(compareDeclarations);
      List<Declaration> sortedSetters =
          new List<Declaration>.from(scope.setters.values)
            ..sort(compareDeclarations);
      List<Declaration> allMembers;
      List<Declaration> allSetters;
      List<Declaration> interfaceMembers;
      List<Declaration> interfaceSetters;
      if (supernode == null) {
        // This should be Object.
        interfaceMembers = allMembers = sortedLocals;
        interfaceSetters = allSetters = sortedSetters;
      } else {
        allMembers = merge(
            cls, sortedLocals, supernode.classMembers, MergeKind.superclass);
        allSetters = merge(
            cls, sortedSetters, supernode.classSetters, MergeKind.superclass);
        List<KernelTypeBuilder> interfaces = cls.interfaces;
        if (interfaces != null) {
          MergeResult result = mergeInterfaces(cls, supernode, interfaces);
          interfaceMembers = result.mergedMembers;
          interfaceSetters = result.mergedSetters;
        } else {
          interfaceMembers = allMembers;
          interfaceSetters = allSetters;
        }
      }
      nodes[cls] = new ClassHierarchyNode(
          cls, scope, allMembers, allSetters, interfaceMembers, interfaceSetters);
      mergeAccessors(cls, allMembers, allSetters);
  
      if (abstractMemberCount != 0 && !cls.isAbstract) {
        if (!hasNoSuchMethod) {
          reportMissingMembers(cls, allMembers, allSetters);
        }
        installNsmHandlers(cls);
      }
  
negative.code:     return type is KernelNamedTypeBuilder ? type.declaration : null;
    }
  
    List<Declaration> merge(KernelClassBuilder cls, List<Declaration> aList,
        List<Declaration> bList, MergeKind mergeKind) {
      final List<Declaration> result = new List<Declaration>.filled(
          aList.length + bList.length, null,
          growable: true);
  
      int storeIndex = 0;
  
      int i = 0;
      int j = 0;
      while (i < aList.length && j < bList.length) {
        final Declaration a = aList[i];
        final Declaration b = bList[j];
        final int compare = compareDeclarations(a, b);
        if (compare == 0) {
          result[storeIndex++] = handleMergeConflict(cls, a, b, mergeKind);
          i++;
          j++;
        } else if (compare < 0) {
          handleOnlyA(a, mergeKind);
          result[storeIndex++] = a;
          i++;
        } else {
          handleOnlyB(cls, b, mergeKind);
          result[storeIndex++] = b;
          j++;
        }
      }
      while (i < aList.length) {
        final Declaration a = aList[i];
        handleOnlyA(a, mergeKind);
        result[storeIndex++] = a;
        i++;
      }
      while (j < bList.length) {
        final Declaration b = bList[j];
        handleOnlyB(cls, b, mergeKind);
        result[storeIndex++] = b;
        j++;
      }
      return result..length = storeIndex;
    }
  }
  
  