blob: d632b1f7908d224af7e1a50d7fcee55f00a17215 [file] [log] [blame]
library test /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/future_then_explicit_future.dart:14:94: Error: A value of type 'List<dynamic>' can't be returned from a function with return type 'FutureOr<Future<List<int>>>'.
// - 'List' is from 'dart:core'.
// - 'Future' is from 'dart:async'.
// /*@returnType=FutureOr<Future<List<int>>>*/ (/*@type=int*/ x) => /*@typeArgs=dynamic*/ []);
// ^
//
// pkg/front_end/testcases/inference/future_then_explicit_future.dart:15:25: Error: A value of type 'Future<Future<List<int>>>' can't be assigned to a variable of type 'Future<List<int>>'.
// - 'Future' is from 'dart:async'.
// - 'List' is from 'dart:core'.
// Future<List<int>> y = x;
// ^
//
import self as self;
import "dart:async" as asy;
import "dart:core" as core;
import "dart:async";
static method m1(asy::Future<core::int> f) dynamic {
asy::Future<asy::Future<core::List<core::int>>> x = f.{asy::Future::then}<asy::Future<core::List<core::int>>>((core::int x) FutureOr<asy::Future<core::List<core::int>>> => invalid-expression "pkg/front_end/testcases/inference/future_then_explicit_future.dart:14:94: Error: A value of type 'List<dynamic>' can't be returned from a function with return type 'FutureOr<Future<List<int>>>'.
- 'List' is from 'dart:core'.
- 'Future' is from 'dart:async'.
/*@returnType=FutureOr<Future<List<int>>>*/ (/*@type=int*/ x) => /*@typeArgs=dynamic*/ []);
^" in core::_GrowableList::•<dynamic>(0) as{TypeError,ForNonNullableByDefault} FutureOr<asy::Future<core::List<core::int>>>){((core::int) FutureOr<asy::Future<core::List<core::int>>>, {onError: core::Function?}) asy::Future<asy::Future<core::List<core::int>>>};
asy::Future<core::List<core::int>> y = invalid-expression "pkg/front_end/testcases/inference/future_then_explicit_future.dart:15:25: Error: A value of type 'Future<Future<List<int>>>' can't be assigned to a variable of type 'Future<List<int>>'.
- 'Future' is from 'dart:async'.
- 'List' is from 'dart:core'.
Future<List<int>> y = x;
^" in x as{TypeError,ForNonNullableByDefault} asy::Future<core::List<core::int>>;
}
static method m2(asy::Future<core::int> f) dynamic {
asy::Future<core::List<core::int>> x = f.{asy::Future::then}<core::List<core::int>>((core::int x) core::List<core::int> => core::_GrowableList::•<core::int>(0)){((core::int) FutureOr<core::List<core::int>>, {onError: core::Function?}) asy::Future<core::List<core::int>>};
asy::Future<core::List<core::int>> y = x;
}
static method main() dynamic {}