Nim/tests/ccgbugs/taddhigh.nim
Andreas Rumpf 920f4acadf fixes #6279
2017-08-29 00:33:46 +02:00

19 lines
217 B
Nim

discard """
output: '''@[5, 5, 5, 5, 5]'''
"""
# bug #1832
var s = @[5]
# Works fine:
let x = s[s.high]
s.add x
# Causes the 0 to appear:
s.add s[s.high]
s.add s[s.len-1]
s.add s[s.xlen-1]
echo s # @[5, 5, 0]