summary refs log tree commit diff stats
path: root/tests/arc/tconst_to_sink.nim
blob: ddcc46e67eeb1def847c6b601b858ce689d88233 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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