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

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

Issue 1370793002: Improve the handling of inference for instance fields in the task model (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments 1 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 | « no previous file | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 3cb4ea36e680f451b72f35243e8eaff8a8524a83..d9d8384db3be4c5298bc4cc2b24146f9e7b6f917 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -9613,12 +9613,13 @@ class PartialResolverVisitor extends ResolverVisitor {
final bool strongMode;
/**
- * The static variables that have an initializer. These are the variables that
- * need to be re-resolved after static variables have their types inferred. A
- * subset of these variables are those whose types should be inferred. The
- * list will be empty unless the resolver is being run in strong mode.
+ * The static variables and fields that have an initializer. These are the
+ * variables that need to be re-resolved after static variables have their
+ * types inferred. A subset of these variables are those whose types should
+ * be inferred. The list will be empty unless the resolver is being run in
+ * strong mode.
*/
- final List<VariableElement> staticVariables = <VariableElement>[];
+ final List<VariableElement> variablesAndFields = <VariableElement>[];
/**
* A flag indicating whether we should discard errors while resolving the
@@ -9671,8 +9672,8 @@ class PartialResolverVisitor extends ResolverVisitor {
@override
Object visitFieldDeclaration(FieldDeclaration node) {
- if (strongMode && node.isStatic) {
- _addStaticVariables(node.fields.variables);
+ if (strongMode) {
+ _addVariables(node.fields.variables);
bool wasDiscarding = discardErrorsInInitializer;
discardErrorsInInitializer = true;
try {
@@ -9699,7 +9700,7 @@ class PartialResolverVisitor extends ResolverVisitor {
@override
Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
if (strongMode) {
- _addStaticVariables(node.variables.variables);
+ _addVariables(node.variables.variables);
bool wasDiscarding = discardErrorsInInitializer;
discardErrorsInInitializer = true;
try {
@@ -9718,10 +9719,10 @@ class PartialResolverVisitor extends ResolverVisitor {
* potentially need to be re-resolved after inference because they might
* refer to a field whose type was inferred.
*/
- void _addStaticVariables(NodeList<VariableDeclaration> variables) {
+ void _addVariables(NodeList<VariableDeclaration> variables) {
for (VariableDeclaration variable in variables) {
if (variable.initializer != null) {
- staticVariables.add(variable.element);
+ variablesAndFields.add(variable.element);
}
}
}
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698