summary refs log tree commit diff stats
path: root/tests/ccgbugs/taddhigh.nim
blob: 549eb8caaf975ea52af8266c502f0c7f02d3d3a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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]