diff --git a/lib/system.nim b/lib/system.nim index 00dd00bc09..687a68119a 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 66b789ee96..ce36895a13 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)