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

Unified Diff: pkg/analyzer/test/src/task/strong/front_end_inference_test.dart

Issue 2928613003: Fix corner cases of type inference with implicit references to `.call`. (Closed)
Patch Set: Created 3 years, 6 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/kernel/body_builder.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 216d1712d9d8d9c6e39238dde1a767cea86f6e4e..9a078bc3ce8f1e8d055307e2c8cd6b3645783017 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
@@ -361,6 +361,15 @@ class _InstrumentationVisitor extends RecursiveAstVisitor<Null> {
@override
visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
super.visitFunctionExpressionInvocation(node);
+ var receiverType = node.function.staticType;
+ if (receiverType is InterfaceType) {
+ // This is a hack since analyzer doesn't record .call targets
+ var target = receiverType.element.lookUpMethod('call', null) ??
+ receiverType.element.lookUpGetter('call', null);
+ if (target != null) {
+ _recordTarget(node.argumentList.offset, target);
+ }
+ }
if (node.typeArguments == null) {
var inferredTypeArguments = _getInferredFunctionTypeArguments(
node.function.staticType,
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698