Skip to content

Commit 0b1ec2d

Browse files
camsteffencommit-bot@chromium.org
authored andcommitted
List.removeLast() docs error occurs if empty
Seems like this should be explicitly stated in the docs. I did not indicate the specific type of error because of #26087. Closes #35894 #35894 GitOrigin-RevId: 271ab85 Change-Id: I0ab38116dfa63046a433ea59470a1bfe279b98a2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107822 Reviewed-by: Lasse R.H. Nielsen <[email protected]> Commit-Queue: Lasse R.H. Nielsen <[email protected]>
1 parent 4ceefdb commit 0b1ec2d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sdk/lib/core/list.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,8 @@ abstract class List<E> implements EfficientLengthIterable<E> {
537537
/**
538538
* Pops and returns the last object in this list.
539539
*
540+
* The list must not be empty.
541+
*
540542
* Throws an [UnsupportedError] if this is a fixed-length list.
541543
*/
542544
E removeLast();

0 commit comments

Comments
 (0)