Skip to content

Commit

Permalink
fixes #6710
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq committed Nov 8, 2017
1 parent 30f97b7 commit 46275f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/system.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions tests/system/tsystem_misc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 46275f6

Please sign in to comment.