Files
sdk/pkg/front_end/testcases/nnbd/issue41602.dart.weak.expect
T
Johnni Winther 665c58aa1a [cfe] Disallow void in await expression
Closes #41602

Change-Id: I29b8880e3fdb769b2acdf2c82a9ced038d7b0d94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149287
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-06-02 08:20:31 +00:00

26 lines
783 B
Plaintext

library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/issue41602.dart:12:9: Error: This expression has type 'void' and can't be used.
// await returnVoid(); // error
// ^
//
// pkg/front_end/testcases/nnbd/issue41602.dart:13:9: Error: This expression has type 'void' and can't be used.
// await returnVoidAsync(); // error
// ^
//
import self as self;
import "dart:async" as asy;
static method returnFutureOfVoid() → asy::Future<void> async {}
static method returnVoid() → void {}
static method returnVoidAsync() → void async {}
static method test() → dynamic async {
await self::returnVoid();
await self::returnVoidAsync();
}
static method main() → dynamic async {
await self::returnFutureOfVoid();
}