From 49324157421d138c3cba39b629bdb88a5b88dc54 Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 23 Jul 2015 17:18:36 +0200 Subject: fixes #1832 --- tests/ccgbugs/taddhigh.nim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/ccgbugs/taddhigh.nim (limited to 'tests/ccgbugs/taddhigh.nim') diff --git a/tests/ccgbugs/taddhigh.nim b/tests/ccgbugs/taddhigh.nim new file mode 100644 index 000000000..d6ac8f650 --- /dev/null +++ b/tests/ccgbugs/taddhigh.nim @@ -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] -- cgit 1.4.1-2-gfad0