| 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 8b00a44b72d537704702e1fb310a9c377c954d5f..0087b3d35a5be8e2cf7b5343a9986cb494b457b4 100644
|
| --- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
|
| +++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
|
| @@ -1609,6 +1609,17 @@ main() {
|
| ''');
|
| }
|
|
|
| + void test_futureThen_explicitFuture() {
|
| + checkFile(r'''
|
| +import "dart:async";
|
| +main() {
|
| + Future<int> f;
|
| + var x = f.then/*<Future<List<int>>>*/(/*info:INFERRED_TYPE_CLOSURE*/(x) => /*info:INFERRED_TYPE_LITERAL*/[]);
|
| + Future<List<int>> y = x;
|
| +}
|
| + ''');
|
| + }
|
| +
|
| void test_futureThen_upwards() {
|
| // Regression test for https://github.com/dart-lang/sdk/issues/27088.
|
| String build({String declared, String downwards, String upwards}) => '''
|
| @@ -1676,24 +1687,6 @@ $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
|
| @@ -1736,6 +1729,24 @@ $downwards<List<int>> g3() async {
|
| build(declared: "Future", 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_genericMethods_basicDownwardInference() {
|
| checkFile(r'''
|
| /*=T*/ f/*<S, T>*/(/*=S*/ s) => null;
|
|
|