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 a8d2788fffebf53c13b6104cfeebfb01202b047f..216d1712d9d8d9c6e39238dde1a767cea86f6e4e 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 |
@@ -411,7 +411,8 @@ class _InstrumentationVisitor extends RecursiveAstVisitor<Null> { |
visitMethodInvocation(MethodInvocation node) { |
super.visitMethodInvocation(node); |
- if (node.target != null) { |
+ var element = node.methodName.staticElement; |
+ if (_elementRequiresMethodDispatch(element)) { |
_recordTarget(node.methodName.offset, node.methodName.staticElement); |
} |
if (node.typeArguments == null) { |
@@ -487,6 +488,17 @@ class _InstrumentationVisitor extends RecursiveAstVisitor<Null> { |
} |
} |
+ bool _elementRequiresMethodDispatch(Element element) { |
+ if (element is ClassMemberElement) { |
+ return !element.isStatic; |
+ } else if (element is ExecutableElement && |
+ element.enclosingElement is ClassElement) { |
+ return !element.isStatic; |
+ } else { |
+ return false; |
+ } |
+ } |
+ |
/// Based on DDC code generator's `_emitFunctionTypeArguments` |
Iterable<DartType> _getInferredFunctionTypeArguments( |
DartType g, DartType f, TypeArgumentList typeArgs) { |