Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Unified Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 1329743005: Abstract over the type system. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/constant.dart ('k') | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/engine.dart
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index c0e548ccf0bee04c3cb17c8ae7256f1746cd34dd..af8b1d0bd8af60f0b17d5e904b53b39e4d82e2dc 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.dart
@@ -429,6 +429,11 @@ abstract class AnalysisContext {
TypeProvider get typeProvider;
/**
+ * Return a type system for this context.
+ */
+ TypeSystem get typeSystem;
+
+ /**
* Add the given [listener] to the list of objects that are to be notified
* when various analysis results are produced in this context.
*/
@@ -1040,6 +1045,11 @@ class AnalysisContextImpl implements InternalAnalysisContext {
TypeProvider _typeProvider;
/**
+ * The [TypeSystem] for this context, `null` if not yet created.
+ */
+ TypeSystem _typeSystem;
+
+ /**
* The object used to manage the list of sources that need to be analyzed.
*/
WorkManager _workManager = new WorkManager();
@@ -1550,6 +1560,14 @@ class AnalysisContextImpl implements InternalAnalysisContext {
}
@override
+ TypeSystem get typeSystem {
+ if (_typeSystem == null) {
+ _typeSystem = TypeSystem.create(this);
+ }
+ return _typeSystem;
+ }
+
+ @override
void addListener(AnalysisListener listener) {
if (!_listeners.contains(listener)) {
_listeners.add(listener);
@@ -8472,6 +8490,7 @@ class GenerateDartErrorsTask extends AnalysisTask {
RecordingErrorListener errorListener = new RecordingErrorListener();
ErrorReporter errorReporter = new ErrorReporter(errorListener, source);
TypeProvider typeProvider = context.typeProvider;
+ TypeSystem typeSystem = context.typeSystem;
//
// Validate the directives
//
@@ -8494,6 +8513,7 @@ class GenerateDartErrorsTask extends AnalysisTask {
errorReporter,
libraryElement,
typeProvider,
+ typeSystem,
new InheritanceManager(libraryElement),
context.analysisOptions.enableSuperMixins);
_unit.accept(errorVerifier);
@@ -10930,6 +10950,7 @@ class ResolveDartUnitTask extends AnalysisTask {
@override
void internalPerform() {
TypeProvider typeProvider = _libraryElement.context.typeProvider;
+ TypeSystem typeSystem = _libraryElement.context.typeSystem;
CompilationUnit unit = context.computeResolvableCompilationUnit(source);
if (unit == null) {
throw new AnalysisException(
@@ -10952,7 +10973,7 @@ class ResolveDartUnitTask extends AnalysisTask {
InheritanceManager inheritanceManager =
new InheritanceManager(_libraryElement);
ResolverVisitor resolverVisitor = new ResolverVisitor(
- _libraryElement, source, typeProvider, errorListener,
+ _libraryElement, source, typeProvider, typeSystem, errorListener,
inheritanceManager: inheritanceManager);
unit.accept(resolverVisitor);
//
@@ -10964,6 +10985,7 @@ class ResolveDartUnitTask extends AnalysisTask {
errorReporter,
_libraryElement,
typeProvider,
+ typeSystem,
inheritanceManager,
context.analysisOptions.enableSuperMixins);
unit.accept(errorVerifier);
« no previous file with comments | « pkg/analyzer/lib/src/generated/constant.dart ('k') | pkg/analyzer/lib/src/generated/error_verifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698