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

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

Issue 1409813002: Fix another place where identifiers were not being re-resolved correctly (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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') | pkg/analyzer/lib/src/task/dart.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/element_resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index ab8fe91b9e3428a78338182cce69b4f509325084..ffe623b8879a2d6fec0def73917e44a4cba80f42 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -974,10 +974,18 @@ class ElementResolver extends SimpleAstVisitor<Object> {
return null;
}
//
- // We ignore identifiers that have already been resolved, such as
- // identifiers representing the name in a declaration.
+ // Ignore nodes that should have been resolved before getting here.
//
- if (node.staticElement != null) {
+ if (node.inDeclarationContext()) {
+ return null;
+ }
+ AstNode parent = node.parent;
+ if (parent is FieldFormalParameter) {
+ return null;
+ } else if (parent is ConstructorFieldInitializer &&
+ parent.fieldName == node) {
+ return null;
+ } else if (parent is Annotation && parent.constructorName == node) {
return null;
}
//
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/task/dart.dart » ('j') | pkg/analyzer/lib/src/task/dart.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698