diff options
-rw-r--r-- | lib/system.nim | 2 | ||||
-rw-r--r-- | tests/system/tsystem_misc.nim | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/system.nim b/lib/system.nim index 00dd00bc0..687a68119 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1518,7 +1518,7 @@ proc delete*[T](x: var seq[T], i: Natural) {.noSideEffect.} = ## i.delete(2) #=> @[1, 2, 4, 5] template defaultImpl = let xl = x.len - for j in i..xl-2: shallowCopy(x[j], x[j+1]) + for j in i.int..xl-2: shallowCopy(x[j], x[j+1]) setLen(x, xl-1) when nimvm: diff --git a/tests/system/tsystem_misc.nim b/tests/system/tsystem_misc.nim index 66b789ee9..ce36895a1 100644 --- a/tests/system/tsystem_misc.nim +++ b/tests/system/tsystem_misc.nim @@ -16,3 +16,7 @@ doAssert high(uint32) > low(uint32) doAssert high(float) > low(float) doAssert high(float32) > low(float32) doAssert high(float64) > low(float64) + +# bug #6710 +var s = @[1] +s.delete(0) |