fixes #13240
This commit is contained in:
parent
861a5340fe
commit
60f8fdcdab
2 changed files with 33 additions and 1 deletions
25
tests/arc/tconst_to_sink.nim
Normal file
25
tests/arc/tconst_to_sink.nim
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
discard """
|
||||
output: '''@[(s1: "333", s2: ""), (s1: "abc", s2: "def"), (s1: "3x", s2: ""), (s1: "3x", s2: ""), (s1: "3x", s2: ""), (s1: "3x", s2: ""), (s1: "lastone", s2: "")]'''
|
||||
cmd: "nim c --gc:arc $file"
|
||||
"""
|
||||
|
||||
# bug #13240
|
||||
|
||||
type
|
||||
Thing = object
|
||||
s1: string
|
||||
s2: string
|
||||
|
||||
var box: seq[Thing]
|
||||
|
||||
const c = [Thing(s1: "333"), Thing(s1: "abc", s2: "def")]
|
||||
|
||||
for i in 0..high(c):
|
||||
box.add c[i]
|
||||
|
||||
for i in 0..3:
|
||||
box.add Thing(s1: "3x")
|
||||
|
||||
box.add Thing(s1: "lastone")
|
||||
|
||||
echo box
|
||||
Loading…
Add table
Add a link
Reference in a new issue