fixes #1832
This commit is contained in:
parent
18823a315e
commit
4932415742
3 changed files with 28 additions and 3 deletions
16
tests/ccgbugs/taddhigh.nim
Normal file
16
tests/ccgbugs/taddhigh.nim
Normal file
|
|
@ -0,0 +1,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]
|
||||
Loading…
Add table
Add a link
Reference in a new issue