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

Unified Diff: pkg/analyzer/lib/src/dart/ast/utilities.dart

Issue 2725013003: Support accessing the parameter element when there is no name (Closed)
Patch Set: Created 3 years, 10 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/dart/ast/ast.dart ('k') | pkg/analyzer/lib/src/dart/element/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/ast/utilities.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/utilities.dart b/pkg/analyzer/lib/src/dart/ast/utilities.dart
index 920e58556a42b6f6101441a81235e00bb327672a..8090044bd44fd349f44a5500ce2be22383cc9402 100644
--- a/pkg/analyzer/lib/src/dart/ast/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/ast/utilities.dart
@@ -6428,12 +6428,16 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitSimpleFormalParameter(SimpleFormalParameter node) {
SimpleFormalParameter toNode = this._toNode as SimpleFormalParameter;
- return _and(
+ if (_and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
_isEqualTokens(node.keyword, toNode.keyword),
_isEqualNodes(node.type, toNode.type),
- _isEqualNodes(node.identifier, toNode.identifier));
+ _isEqualNodes(node.identifier, toNode.identifier))) {
+ (toNode as SimpleFormalParameterImpl).element = node.element;
+ return true;
+ }
+ return false;
}
@override
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/ast.dart ('k') | pkg/analyzer/lib/src/dart/element/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698