summary refs log blame commit diff stats
path: root/tests/ccgbugs/taddhigh.nim
blob: 6b0658612320ea6a04c9ca4fab5329b04dbe0866 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
           
                                












                         
                
                
 
                   
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.len-1]

echo s # @[5, 5, 0]