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

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

Issue 2846463003: Instrument analyzer's type analysis and run front_end inference tests. (Closed)
Patch Set: Updates. Created 3 years, 8 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/resolver.dart ('k') | pkg/analyzer/test/src/dart/analysis/base.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index 1c5b9996a579c52c77f2cc605950147e4ee57ab8..d7eed746e551c3ffb2064e52e6b7d903716c1c86 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -1333,6 +1333,11 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
} else if (element is VariableElement) {
VariableElement variable = element;
staticType = _promoteManager.getStaticType(variable);
+ if (_resolver.instrumentation != null && node.inGetterContext()) {
+ node.inGetterContext();
+ DartType type = _promoteManager.getType(variable);
+ _resolver.instrumentation.recordPromotion(node.offset, type);
+ }
} else if (element is PrefixElement) {
return null;
} else if (element is DynamicElementImpl) {
@@ -2097,6 +2102,7 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
if (type != null && !type.isBottom && !type.isDartCoreNull) {
VariableElement element = node.element;
if (element is LocalVariableElementImpl) {
+ _resolver.instrumentation?.recordInference(node.name.offset, type);
element.type = initializer.staticType;
node.name.staticType = initializer.staticType;
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/src/dart/analysis/base.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698