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

Unified Diff: pkg/analyzer/lib/src/task/strong/checker.dart

Issue 1568643002: clean up generic methods in resolution (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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/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);
}

Powered by Google App Engine
This is Rietveld 408576698