Use StoreBasedSummaryResynthesizer directly in LibraryContext.
R=brianwilkerson@google.com
Change-Id: I29583bf4f63bf47b54982688d0f10df02745f7fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97009
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/lib/src/dart/analysis/library_context.dart b/pkg/analyzer/lib/src/dart/analysis/library_context.dart
index 9c82bd8..2b3f303 100644
--- a/pkg/analyzer/lib/src/dart/analysis/library_context.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/library_context.dart
@@ -6,7 +6,6 @@
import 'package:analyzer/dart/analysis/session.dart';
import 'package:analyzer/dart/element/element.dart'
show CompilationUnitElement, LibraryElement;
-import 'package:analyzer/src/context/context.dart';
import 'package:analyzer/src/dart/analysis/byte_store.dart';
import 'package:analyzer/src/dart/analysis/driver.dart';
import 'package:analyzer/src/dart/analysis/file_state.dart';
@@ -43,7 +42,7 @@
/// We use it as an approximation for the heap size of elements.
int _linkedDataInBytes = 0;
- AnalysisContextImpl analysisContext;
+ RestrictedAnalysisContext analysisContext;
SummaryResynthesizer resynthesizer;
InheritanceManager2 inheritanceManager;
@@ -72,9 +71,10 @@
// Fill the store with summaries required for the initial library.
load(targetLibrary);
- var provider = new InputPackagesResultProvider(analysisContext, store,
- session: session);
- resynthesizer = provider.resynthesizer;
+ resynthesizer = new StoreBasedSummaryResynthesizer(
+ analysisContext, session, sourceFactory, true, store);
+ analysisContext.typeProvider = resynthesizer.typeProvider;
+ resynthesizer.finishCoreAsyncLibraries();
inheritanceManager = new InheritanceManager2(analysisContext.typeSystem);
}