mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:16:51 +00:00
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:
parent
b0b6a289ec
commit
1a9d38be41
|
@ -5,7 +5,7 @@
|
||||||
// SharedOptions=--enable-experiment=non-nullable
|
// SharedOptions=--enable-experiment=non-nullable
|
||||||
|
|
||||||
// Test that it is an error to use nullable types in unsound ways.
|
// Test that it is an error to use nullable types in unsound ways.
|
||||||
void main() {
|
void main() async {
|
||||||
int? x;
|
int? x;
|
||||||
bool? cond;
|
bool? cond;
|
||||||
List? list;
|
List? list;
|
||||||
|
@ -51,10 +51,11 @@ void main() {
|
||||||
cond != null; //# 33: ok
|
cond != null; //# 33: ok
|
||||||
x?.isEven; //# 34: ok
|
x?.isEven; //# 34: ok
|
||||||
x?.round(); //# 35: 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() {
|
generator() sync* {
|
||||||
Stream? stream;
|
Iterable? iter;
|
||||||
yield stream; //# 37: compile-time error
|
yield* iter; //# 38: compile-time error
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue