summary refs log blame commit diff stats
path: root/tests/arc/tconst_to_sink.nim
blob: ddcc46e67eeb1def847c6b601b858ce689d88233 (plain) (tree)
























                                                                                                                                                                       
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