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

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_test.dart

Issue 2425143002: fix #27284, allow FutureUnionType to be preserved during generic inference (Closed)
Patch Set: feedback Created 4 years, 2 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 da86f94ba7a0ef31a7751d4abe471c5b81a1ec1c..b6e116a429073b0aaf032a331aea7cc9c8a52ca9 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -1740,7 +1740,7 @@ $downwards<List<int>> g3() async {
build(declared: "Future", downwards: "Future", upwards: "MyFuture"));
}
- void test_futureUnion_downwardsGenericMethods() {
+ void test_futureUnion_downwardsGenericMethodWithFutureReturn() {
// Regression test for https://github.com/dart-lang/sdk/issues/27134
//
// We need to take a future union into account for both directions of
@@ -1758,6 +1758,20 @@ class A {}
''');
}
+ void test_futureUnion_downwardsGenericMethodWithGenericReturn() {
+ // Regression test for https://github.com/dart-lang/sdk/issues/27284
+ checkFile(r'''
+import 'dart:async';
+
+/*=T*/ id/*<T>*/(/*=T*/ x) => x;
+
+main() async {
+ Future<String> f;
+ String s = await id(f);
+}
+ ''');
+ }
+
void test_futureUnion_upwardsGenericMethods() {
// Regression test for https://github.com/dart-lang/sdk/issues/27151
checkFile(r'''
« 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