diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart index 3cc50a682ba3..c61ee71e40df 100644 --- a/sdk/lib/collection/list.dart +++ b/sdk/lib/collection/list.dart @@ -363,7 +363,6 @@ abstract class ListMixin implements List { void shuffle([Random? random]) { random ??= Random(); - if (random == null) throw "!"; // TODO(38493): The `??=` should promote. int length = this.length; while (length > 1) { @@ -384,7 +383,6 @@ abstract class ListMixin implements List { List sublist(int start, [int? end]) { int listLength = this.length; end ??= listLength; - if (end == null) throw "!"; // TODO(38493): The `??=` should promote. RangeError.checkValidRange(start, end, listLength); return List.from(getRange(start, end));