Raise IndexDefect when deleting element at out of bounds index (#17821)

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
Co-authored-by: Heiko Nickerl <mail@hnicke.de>
Co-authored-by: Heiko Nickerl <heiko.nickerl@flipapp.de>
This commit is contained in:
Heiko Nickerl 2021-06-20 17:56:33 +02:00 • committed by GitHub
commit 92cb765714
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 70 additions and 36 deletions

View file

@ -59,11 +59,6 @@ doAssert high(float) > low(float)
doAssert high(float32) > low(float32)
doAssert high(float64) > low(float64)
# bug #6710
var s = @[1]
s.delete(0)
proc foo(a: openArray[int]) =
for x in a: echo x