anchor.diff:          new FileContentOverlay(),
           null,
           sourceFactory,
  -        analysisOptions as AnalysisOptionsImpl,
  +        analysisOptions,
           externalSummaries: summaryDataStore);
  -    analysisDriver.declaredVariables =
  -        new DeclaredVariables.fromMap(options.definedVariables);
  +
  +    declaredVariables = new DeclaredVariables.fromMap(options.definedVariables);
  +    analysisDriver.declaredVariables = declaredVariables;
  +
  +    if (buildSummary2) {
  +      _createLinkedElementFactory();
  +    }
   
       scheduler.start();
  +  }
  +
  +  void _createLinkedElementFactory() {
  +    var rootReference = summary2.Reference.root();
  +    var dartCoreRef = rootReference.getChild('dart:core');
  +    dartCoreRef.getChild('dynamic').element = DynamicElementImpl.instance;
  +    dartCoreRef.getChild('Never').element = NeverElementImpl.instance;
  +
  +    var analysisContext = RestrictedAnalysisContext(
  +      SynchronousSession(analysisOptions, declaredVariables),
  +      sourceFactory,
  +    );
  +
  +    elementFactory = summary2.LinkedElementFactory(
  +      analysisContext,
  +      null,
  +      rootReference,
  +    );
  +
  +    for (var bundle in summaryDataStore.bundles) {
  +      elementFactory.addBundle(
  +        summary2.LinkedBundleContext(elementFactory, bundle.bundle2),
  +      );
  +    }
     }
   
     /**
  
positive.code: 
  import 'package:analyzer/dart/analysis/declared_variables.dart';
  import 'package:analyzer/dart/analysis/results.dart';
  import 'package:analyzer/error/error.dart';
  import 'package:analyzer/file_system/file_system.dart';
  import 'package:analyzer/src/dart/analysis/byte_store.dart';
  
negative.code:   final ContextCache contextCache;
  
    SummaryDataStore summaryDataStore;
    AnalysisOptionsImpl analysisOptions;
    Map<Uri, File> uriToFileMap;
    final List<Source> explicitSources = <Source>[];
    final List<PackageBundle> unlinkedBundles = <PackageBundle>[];
  
    SourceFactory sourceFactory;
    DeclaredVariables declaredVariables;
    AnalysisDriver analysisDriver;
  
    PackageBundleAssembler assembler;
    final Map<String, UnlinkedUnit> uriToUnit = <String, UnlinkedUnit>{};
  
    final bool buildSummary2 = true;
    final Map<String, ParsedUnitResult> inputParsedUnitResults = {};
    summary2.LinkedElementFactory elementFactory;
  
    // May be null.
    final DependencyTracker dependencyTracker;
  