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

Unified Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2770143002: More generic function type cases working (Closed)
Patch Set: Created 3 years, 9 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
Index: pkg/analyzer/lib/src/dart/element/element.dart
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 49ef06fd51e71cba15aa20c935b1ea8b208e9e7f..0636e28a842d47da4bfd8b3cd183b25a2d2b20da 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -5172,10 +5172,11 @@ class GenericTypeAliasElementImpl extends ElementImpl
}
@override
- List<ParameterElement> get parameters => function.parameters;
+ List<ParameterElement> get parameters =>
+ function?.parameters ?? const <ParameterElement>[];
@override
- DartType get returnType => function.returnType;
+ DartType get returnType => function?.returnType;
@override
FunctionType get type {
@@ -5227,7 +5228,9 @@ class GenericTypeAliasElementImpl extends ElementImpl
buffer.write(">");
}
buffer.write(" = ");
- (function as FunctionElementImpl).appendTo(buffer);
+ if (function != null) {
+ (function as ElementImpl).appendTo(buffer);
+ }
}
@override
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/builder.dart ('k') | pkg/analyzer/lib/src/generated/declaration_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698