blob: 42ab56959dad3f6378fa87eb234a8f2b5d933684 [file] [log] [blame]
library test /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/async_await2.dart:25:48: Error: A value of type 'Future<Future<int>>' can't be returned from an async function with return type 'Future<int>'.
// - 'Future' is from 'dart:async'.
// /*@returnType=Future<int>*/ test2() async => x2;
// ^
//
// pkg/front_end/testcases/inference/async_await2.dart:26:48: Error: A value of type 'Future<FutureOr<int>>' can't be returned from an async function with return type 'Future<int>'.
// - 'Future' is from 'dart:async'.
// /*@returnType=Future<int>*/ test3() async => x3;
// ^
//
// pkg/front_end/testcases/inference/async_await2.dart:27:48: Error: A value of type 'Future<MyFuture>' can't be returned from an async function with return type 'Future<int>'.
// - 'Future' is from 'dart:async'.
// - 'MyFuture' is from 'pkg/front_end/testcases/inference/async_await2.dart'.
// /*@returnType=Future<int>*/ test4() async => x4;
// ^
//
// pkg/front_end/testcases/inference/async_await2.dart:29:48: Error: A value of type 'FutureOr<Future<int>>' can't be returned from an async function with return type 'Future<int>'.
// - 'Future' is from 'dart:async'.
// /*@returnType=Future<int>*/ test6() async => x6;
// ^
//
// pkg/front_end/testcases/inference/async_await2.dart:30:48: Error: A value of type 'FutureOr<FutureOr<int>>' can't be returned from an async function with return type 'Future<int>'.
// - 'Future' is from 'dart:async'.
// /*@returnType=Future<int>*/ test7() async => x7;
// ^
//
// pkg/front_end/testcases/inference/async_await2.dart:31:48: Error: A value of type 'FutureOr<MyFuture>' can't be returned from an async function with return type 'Future<int>'.
// - 'MyFuture' is from 'pkg/front_end/testcases/inference/async_await2.dart'.
// - 'Future' is from 'dart:async'.
// /*@returnType=Future<int>*/ test8() async => x8;
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
import "dart:async";
abstract class MyFuture extends core::Object implements asy::Future<core::int> {
synthetic constructor •() self::MyFuture
: super core::Object::•()
;
}
static method test(core::int x0, asy::Future<core::int> x1, asy::Future<asy::Future<core::int>> x2, asy::Future<FutureOr<core::int>> x3, asy::Future<self::MyFuture> x4, FutureOr<core::int>x5, FutureOr<asy::Future<core::int>>x6, FutureOr<FutureOr<core::int>>x7, FutureOr<self::MyFuture>x8, self::MyFuture x9) void async /* futureValueType= void */ {
function test0() asy::Future<core::int> async /* futureValueType= core::int */
return x0;
function test1() asy::Future<core::int> async /* futureValueType= core::int */
return x1;
function test2() asy::Future<core::int> async /* futureValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/async_await2.dart:25:48: Error: A value of type 'Future<Future<int>>' can't be returned from an async function with return type 'Future<int>'.
- 'Future' is from 'dart:async'.
/*@returnType=Future<int>*/ test2() async => x2;
^" in x2 as{TypeError,ForNonNullableByDefault} core::int;
function test3() asy::Future<core::int> async /* futureValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/async_await2.dart:26:48: Error: A value of type 'Future<FutureOr<int>>' can't be returned from an async function with return type 'Future<int>'.
- 'Future' is from 'dart:async'.
/*@returnType=Future<int>*/ test3() async => x3;
^" in x3 as{TypeError,ForNonNullableByDefault} core::int;
function test4() asy::Future<core::int> async /* futureValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/async_await2.dart:27:48: Error: A value of type 'Future<MyFuture>' can't be returned from an async function with return type 'Future<int>'.
- 'Future' is from 'dart:async'.
- 'MyFuture' is from 'pkg/front_end/testcases/inference/async_await2.dart'.
/*@returnType=Future<int>*/ test4() async => x4;
^" in x4 as{TypeError,ForNonNullableByDefault} core::int;
function test5() asy::Future<core::int> async /* futureValueType= core::int */
return x5;
function test6() asy::Future<core::int> async /* futureValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/async_await2.dart:29:48: Error: A value of type 'FutureOr<Future<int>>' can't be returned from an async function with return type 'Future<int>'.
- 'Future' is from 'dart:async'.
/*@returnType=Future<int>*/ test6() async => x6;
^" in x6 as{TypeError,ForNonNullableByDefault} core::int;
function test7() asy::Future<core::int> async /* futureValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/async_await2.dart:30:48: Error: A value of type 'FutureOr<FutureOr<int>>' can't be returned from an async function with return type 'Future<int>'.
- 'Future' is from 'dart:async'.
/*@returnType=Future<int>*/ test7() async => x7;
^" in x7 as{TypeError,ForNonNullableByDefault} core::int;
function test8() asy::Future<core::int> async /* futureValueType= core::int */
return invalid-expression "pkg/front_end/testcases/inference/async_await2.dart:31:48: Error: A value of type 'FutureOr<MyFuture>' can't be returned from an async function with return type 'Future<int>'.
- 'MyFuture' is from 'pkg/front_end/testcases/inference/async_await2.dart'.
- 'Future' is from 'dart:async'.
/*@returnType=Future<int>*/ test8() async => x8;
^" in x8 as{TypeError,ForNonNullableByDefault} core::int;
function test9() asy::Future<core::int> async /* futureValueType= core::int */
return x9;
core::int y0 = await x0;
core::int y1 = await x1;
asy::Future<core::int> y2 = await x2;
FutureOr<core::int>y3 = await x3;
self::MyFuture y4 = await x4;
core::int y5 = await x5;
asy::Future<core::int> y6 = await x6;
FutureOr<core::int>y7 = await x7;
self::MyFuture y8 = await x8;
core::int y9 = await x9;
}
static method main() dynamic {}