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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart

Issue 2911683003: Add type inference support for "call" invocations of function expressions. (Closed)
Patch Set: Created 3 years, 7 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/front_end/lib/src/fasta/type_inference/type_inferrer.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 0539e2cb8b59551f33d2de7b89455121b8ca043b..a2f1cb786f49a993e4fdd8ccefcee47da286a3f5 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -234,9 +234,13 @@ abstract class TypeInferrerImpl extends TypeInferrer {
} else if (receiverType is DynamicType) {
return _functionReturningDynamic;
} else if (receiverType is FunctionType) {
- // TODO(paulberry): handle the case of invoking .call() or .toString() on
- // a function type.
- return _functionReturningDynamic;
+ if (methodName.name == 'call') {
+ return receiverType;
+ } else {
+ // TODO(paulberry): handle the case of invoking .toString() on a
+ // function type.
+ return _functionReturningDynamic;
+ }
} else if (receiverType is TypeParameterType) {
// TODO(paulberry): use the bound
return _functionReturningDynamic;
« no previous file with comments | « pkg/analyzer/test/src/task/strong/front_end_inference_test.dart ('k') | pkg/front_end/test/fasta/strong.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698