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

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

Issue 1492373002: Fix for DeclarationResolver and invalid getters/setters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/test/generated/declaration_resolver_test.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 b80ed5a2deaca94429c70bb7a6759ea33bb33889..c126b44a31e72e35f94d5878ff1112297d27e232 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -2154,13 +2154,18 @@ class DeclarationResolver extends RecursiveAstVisitor<Object> {
_findIdentifier(_enclosingUnit.functions, functionName);
}
} else {
- PropertyAccessorElement accessor =
- _findIdentifier(_enclosingUnit.accessors, functionName);
- if ((property as sc.KeywordToken).keyword == sc.Keyword.SET) {
- accessor = accessor.variable.setter;
- functionName.staticElement = accessor;
+ if (_enclosingExecutable != null) {
+ _enclosingExecutable =
+ _findIdentifier(_enclosingExecutable.functions, functionName);
+ } else {
+ PropertyAccessorElement accessor =
+ _findIdentifier(_enclosingUnit.accessors, functionName);
+ if ((property as sc.KeywordToken).keyword == sc.Keyword.SET) {
+ accessor = accessor.variable.setter;
+ functionName.staticElement = accessor;
+ }
+ _enclosingExecutable = accessor;
}
- _enclosingExecutable = accessor;
}
node.functionExpression.element = _enclosingExecutable;
return super.visitFunctionDeclaration(node);
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/declaration_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698