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

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_test.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. 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 | « pkg/analyzer/lib/src/generated/type_system.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index 5405293e7a4473e9f769d8ad82d86d9e2959f9f0..8b00a44b72d537704702e1fb310a9c377c954d5f 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -1676,6 +1676,24 @@ $downwards<int> g3(bool x) async {
checkFile(build(downwards: "Future", upwards: "MyFuture"));
}
+ void test_futureUnion_downwardsGenericMethods() {
+ // Regression test for https://github.com/dart-lang/sdk/issues/27134
+ //
+ // We need to take a future union into account for both directions of
+ // generic method inference.
+ checkFile(r'''
+import 'dart:async';
+
+foo() async {
+ Future<List<A>> f1 = null;
+ Future<List<A>> f2 = null;
+ List<List<A>> merged = await Future.wait(/*info:INFERRED_TYPE_LITERAL*/[f1, f2]);
+}
+
+class A {}
+ ''');
+ }
+
void test_futureUnion_downwards() {
String build({String declared, String downwards, String upwards}) {
// TODO(leafp): The use of matchTypes in visitInstanceCreationExpression
« no previous file with comments | « pkg/analyzer/lib/src/generated/type_system.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698