mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 14:39:38 +00:00
[3.0 alpha][test] Remove use of NullThrownError
Change-Id: Ia28b44a9acdcb9a38ebb101029dc50b58d272b23 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275786 Reviewed-by: Sigmund Cherem <sigmund@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com> Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
parent
6d05f249ff
commit
d0d2e2591f
|
@ -34,7 +34,7 @@ void testValue(var o) {
|
|||
try {
|
||||
throw o;
|
||||
} on List<String> catch (e) {
|
||||
} on NullThrownError catch (e) {
|
||||
} on TypeError catch (e) {
|
||||
} on Unresolved9 catch (e) {
|
||||
} catch (e) {
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ void testValue(var o) {
|
|||
try {
|
||||
throw o;
|
||||
} on List<Unresolved10> catch (e) {
|
||||
} on NullThrownError catch (e) {
|
||||
} on TypeError catch (e) {
|
||||
} on Unresolved11 catch (e) {
|
||||
} catch (e) {
|
||||
}
|
||||
|
|
|
@ -18,11 +18,11 @@ main() async {
|
|||
// `throw a!` means `throw (a!)`, not `(throw a)!`. Since it's a compile-time
|
||||
// error for a thrown expression to be potentially nullable, this is
|
||||
// sufficient to verify that the compiler has resolved the ambiguity
|
||||
// correctly. We check the runtime behavior by verifying that the error that
|
||||
// is thrown is not `NullThrownError`.
|
||||
Expect.throws(() {
|
||||
throw a!;
|
||||
}, (error) => error is! NullThrownError);
|
||||
// correctly. We check the runtime behavior by verifying that an error is
|
||||
// thrown from the `a!`.
|
||||
Expect.throws(() {
|
||||
throw a!;
|
||||
});
|
||||
|
||||
// `() => a!` means `() => (a!)`, not `(() => a)!`. We check the compile-time
|
||||
// behavior by trying to assign to a function returning non-null. We check
|
||||
|
|
|
@ -36,7 +36,7 @@ void testValue(var o) {
|
|||
try {
|
||||
throw o;
|
||||
} on List<String> catch (e) {
|
||||
} on NullThrownError catch (e) {
|
||||
} on TypeError catch (e) {
|
||||
} on Unresolved9 catch (e) {
|
||||
} catch (e) {
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ void testValue(var o) {
|
|||
try {
|
||||
throw o;
|
||||
} on List<Unresolved10> catch (e) {
|
||||
} on NullThrownError catch (e) {
|
||||
} on TypeError catch (e) {
|
||||
} on Unresolved11 catch (e) {
|
||||
} catch (e) {
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue