Index: pkg/analyzer/lib/src/task/strong/checker.dart |
diff --git a/pkg/analyzer/lib/src/task/strong/checker.dart b/pkg/analyzer/lib/src/task/strong/checker.dart |
index 2ad6c599a76c6ef1fb148ff454df4376c5ff0aa1..d6c436857dc59ce24c97ba4386e5ee47518aa2e7 100644 |
--- a/pkg/analyzer/lib/src/task/strong/checker.dart |
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart |
@@ -788,8 +788,14 @@ class CodeChecker extends RecursiveAstVisitor { |
/// in the caller position of a call (that is, accounting |
/// for the possibility of a call method). Returns null |
/// if expression is not statically callable. |
- FunctionType _getTypeAsCaller(Expression applicand) { |
- var t = applicand.staticType ?? DynamicTypeImpl.instance; |
+ FunctionType _getTypeAsCaller(Expression node) { |
+ DartType t = node.staticType; |
+ if (node is SimpleIdentifier) { |
+ Expression parent = node.parent; |
+ if (parent is MethodInvocation) { |
+ t = parent.staticInvokeType; |
+ } |
+ } |
if (t is InterfaceType) { |
return rules.getCallMethodType(t); |
} |