Skip to content

Return a runtime error for out of bounds std.removeAt - #896

Open
Hashim1999164 wants to merge 1 commit into
google:masterfrom
Hashim1999164:fix/removeat-out-of-bounds-runtime-error
Open

Return a runtime error for out of bounds std.removeAt#896
Hashim1999164 wants to merge 1 commit into
google:masterfrom
Hashim1999164:fix/removeat-out-of-bounds-runtime-error

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Aug 19, 2026

Copy link
Copy Markdown

Fixes #893

std.removeAt sliced the array without checking the index, so an out of bounds or negative index panicked as INTERNAL ERROR.

It now reports the same runtime error as array indexing: Index N out of bounds, not within [0, len).

Tests cover a too large index and a negative index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

std.removeAt crashes (INTERNAL ERROR) on out-of-bounds index

1 participant