anchor.diff:        List<LibraryBuilder> reusedLibraries = computeReusedLibraries(
             invalidatedUris, uriTranslator,
             notReused: notReusedLibraries);
  -      Set<Uri> reusedLibraryUris =
  -          new Set<Uri>.from(reusedLibraries.map((b) => b.uri));
  -      bool removedBuilders = false;
  -      for (Uri uri in new Set<Uri>.from(dillLoadedData.loader.builders.keys)
  -        ..removeAll(reusedLibraryUris)) {
  -        LibraryBuilder builder = dillLoadedData.loader.builders.remove(uri);
  -        userBuilders?.remove(uri);
  +
  +      bool removedDillBuilders = false;
  +      for (LibraryBuilder builder in notReusedLibraries) {
           CompilerContext.current.uriToSource.remove(builder.fileUri);
  -        removedBuilders = true;
  -      }
  -      if (removedBuilders) {
  +
  +        LibraryBuilder dillBuilder =
  +            dillLoadedData.loader.builders.remove(builder.uri);
  +        if (dillBuilder != null) {
  +          removedDillBuilders = true;
  +          userBuilders?.remove(builder.uri);
  +        }
  +
  +        // Remove component problems for libraries we don't reuse.
  +        if (remainingComponentProblems.isNotEmpty) {
  +          Library lib = builder.target;
  +          removeLibraryFromRemainingComponentProblems(lib, uriTranslator);
  +        }
  +      }
  +
  +      if (removedDillBuilders) {
           dillLoadedData.loader.libraries.clear();
           for (LibraryBuilder builder in dillLoadedData.loader.builders.values) {
             dillLoadedData.loader.libraries.add(builder.target);
  
positive.code: 
    /// Internal method.
    Future loadEnsureLoadedComponents(
        Set<Uri> reusedLibraryUris, List<LibraryBuilder> reusedLibraries) async {
      if (modulesToLoad != null) {
        bool loadedAnything = false;
        for (Component module in modulesToLoad) {
          bool usedComponent = false;
          for (Library lib in module.libraries) {
            if (!reusedLibraryUris.contains(lib.importUri)) {
              dillLoadedData.loader.libraries.add(lib);
              dillLoadedData.addLibrary(lib);
              reusedLibraries.add(dillLoadedData.loader.read(lib.importUri, -1));
  
negative.code:             " of ${userCode.loader.builders.length} libraries");
        }
  
        await loadEnsureLoadedComponents(reusedLibraries);
  
        KernelTarget userCodeOld = userCode;
        userCode = new KernelTarget(
  