summary refs log tree commit diff stats
path: root/tests/ccgbugs/taddhigh.nim
blob: d6ac8f6503ace85878bb13f41d2156e9c1e3c5dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
discard """
  output: '''@[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]

echo s # @[5, 5, 0]