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

Unified Diff: pkg/analyzer/test/src/task/strong/front_end_inference_test.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
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
index 7cbd12add11a65cd2e1323f08d22a9c514cc92fa..fbd285988c5f5264b112a96e0ba2d0944a514a11 100644
--- a/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
+++ b/pkg/analyzer/test/src/task/strong/front_end_inference_test.dart
@@ -312,6 +312,21 @@ class _InstrumentationVisitor extends RecursiveAstVisitor<Null> {
}
}
+ @override
+ visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
+ super.visitFunctionExpressionInvocation(node);
+ if (node.typeArguments == null) {
+ var inferredTypeArguments = _getInferredFunctionTypeArguments(
+ node.function.staticType,
+ node.staticInvokeType,
+ node.typeArguments)
+ .toList();
+ if (inferredTypeArguments.isNotEmpty) {
+ _recordTypeArguments(node.argumentList.offset, inferredTypeArguments);
+ }
+ }
+ }
+
visitIndexExpression(IndexExpression node) {
super.visitIndexExpression(node);
_recordMethodTarget(node.leftBracket.charOffset, node.staticElement);
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698