From 46275f6b8fb448b51e68225fd42e69d53e65f562 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Wed, 8 Nov 2017 15:45:26 +0100 Subject: [PATCH] fixes #6710 --- lib/system.nim | 2 +- tests/system/tsystem_misc.nim | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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)