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

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

Issue 2654653003: First step toward resolving generic function types (Closed)
Patch Set: Created 3 years, 11 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/element/type.dart ('k') | no next file » | 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 3c113ced4feaf4ce0f45571f2920509d5c2be858..88860d108fafb52ca74c03a91b1a6e8827f45a09 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -9846,6 +9846,23 @@ class TypeResolverVisitor extends ScopedVisitor {
}
@override
+ Object visitGenericFunctionType(GenericFunctionType node) {
+ DartType returnType = node.returnType?.type ?? DynamicTypeImpl.instance;
+ List<TypeParameterElement> typeParameters = node
+ .typeParameters.typeParameters
+ .map((TypeParameter parameter) =>
+ parameter.element as TypeParameterElement)
+ .toList();
+ List<ParameterElement> parameters = node.parameters.parameters
+ .map((FormalParameter parameter) => parameter.element)
+ .toList();
+ (node as GenericFunctionTypeImpl).type =
+ new FunctionTypeImpl.forGenericFunctionType(
+ typeParameters, DartType.EMPTY_LIST, returnType, parameters, false);
+ return null;
+ }
+
+ @override
Object visitMethodDeclaration(MethodDeclaration node) {
super.visitMethodDeclaration(node);
ExecutableElementImpl element = node.element as ExecutableElementImpl;
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/type.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698