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

Unified Diff: pkg/analyzer/lib/src/dart/ast/ast.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 | « no previous file | pkg/analyzer/lib/src/dart/ast/utilities.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/ast.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart
index 0a364cf9dc2b128fbeca46d8b760a5019dddf5fc..398fa65acc662b5cf3091196609dda146792cfc1 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast.dart
@@ -5831,8 +5831,9 @@ class GenericTypeAliasImpl extends TypeAliasImpl implements GenericTypeAlias {
..add(_typeParameters)
..add(equals)
..add(_functionType);
+
@override
- Element get element => null;
+ Element get element => name.staticElement;
@override
GenericFunctionType get functionType => _functionType;
@@ -5855,7 +5856,6 @@ class GenericTypeAliasImpl extends TypeAliasImpl implements GenericTypeAlias {
return visitor.visitGenericTypeAlias(this);
}
- // TODO: implement element
@override
void visitChildren(AstVisitor visitor) {
super.visitChildren(visitor);
@@ -9239,6 +9239,9 @@ class SimpleFormalParameterImpl extends NormalFormalParameterImpl
*/
TypeAnnotation _type;
+ @override
+ ParameterElement element;
+
/**
* Initialize a newly created formal parameter. Either or both of the
* [comment] and [metadata] can be `null` if the parameter does not have the
@@ -9276,7 +9279,7 @@ class SimpleFormalParameterImpl extends NormalFormalParameterImpl
super._childEntities..add(keyword)..add(_type)..add(identifier);
@override
- Token get endToken => identifier.endToken;
+ Token get endToken => identifier?.endToken ?? type?.endToken;
@override
bool get isConst => keyword?.keyword == Keyword.CONST;
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/dart/ast/utilities.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698