Fix improper unchecked_nullable test cases

Change-Id: I31aa8f1f53b8960550b9ab8d8cc63f670a20558b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
This commit is contained in:
Mike Fairhurst 2019-05-10 19:30:38 +00:00 committed by commit-bot@chromium.org
parent b0b6a289ec
commit 1a9d38be41

View file

@ -5,7 +5,7 @@
// SharedOptions=--enable-experiment=non-nullable
// Test that it is an error to use nullable types in unsound ways.
void main() {
void main() async {
int? x;
bool? cond;
List? list;
@ -51,10 +51,11 @@ void main() {
cond != null; //# 33: ok
x?.isEven; //# 34: ok
x?.round(); //# 35: ok
await for(i in stream) {}; //# 36: compile-time error
for(i in list) {}; //# 36: compile-time error
await for(i in stream) {}; //# 37: compile-time error
}
generator() {
Stream? stream;
yield stream; //# 37: compile-time error
generator() sync* {
Iterable? iter;
yield* iter; //# 38: compile-time error
}