From faf802746561233ab12179e12190e48cfb76a157 Mon Sep 17 00:00:00 2001 From: Nicholas Shahan Date: Wed, 14 Dec 2022 21:37:27 +0000 Subject: [PATCH] [tests] Update expectation to TypeError TypeError is now expected in the place of NullThrownError which is being removed in Dart 3.0. Change-Id: Ibb7188d993216067650d4b994a303f2bcd1d2298 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275742 Reviewed-by: Leaf Petersen Commit-Queue: Nicholas Shahan --- tests/language_2/exception/exception_test.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/language_2/exception/exception_test.dart b/tests/language_2/exception/exception_test.dart index 805fadbfac1..9f60b8ae968 100644 --- a/tests/language_2/exception/exception_test.dart +++ b/tests/language_2/exception/exception_test.dart @@ -26,11 +26,12 @@ class ExceptionTest { bool correctCatch = false; try { - // This throws NullThrownError + // This used to throw a NullThrownError but that error was removed in + // Dart 3.0. Now it throws a TypeError. throw null; } on String catch (s) { correctCatch = false; - } on NullThrownError catch (e) { + } on TypeError catch (e) { correctCatch = true; } catch (x) { correctCatch = false;