Chromium Code Reviews

Unified Diff: pkg/analyzer/lib/src/generated/static_type_analyzer.dart

Issue 2280463002: fix #27134, future unions in downwards generic method inference (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: format Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/generated/type_system.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index 628c340c7848f7a473a69525538c683a65e7c74d..d6787516f05949c6217b0ce300563e99db1685a2 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -1944,16 +1944,6 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
}
}
- DartType returnContext = InferenceContext.getContext(node);
- DartType returnType;
- if (returnContext is FutureUnionType) {
- returnType = _resolver.isSubtypeOfFuture(fnType.returnType)
- ? returnContext.futureOfType
- : returnContext.type;
- } else {
- returnType = returnContext;
- }
-
// Special case Future<T>.then upwards inference. It has signature:
//
// <S>(T -> (S | Future<S>)) -> Future<S>
@@ -1991,8 +1981,8 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
}
}
}
- return ts.inferGenericFunctionCall(
- _typeProvider, fnType, paramTypes, argTypes, returnType);
+ return ts.inferGenericFunctionCall(_typeProvider, fnType, paramTypes,
+ argTypes, InferenceContext.getContext(node));
}
return null;
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/generated/type_system.dart » ('j') | no next file with comments »

Powered by Google App Engine