tconst_to_sink.nim 490 B

123456789101112131415161718192021222324252627
  1. discard """
  2. output: '''@[(s1: "333", s2: ""), (s1: "abc", s2: "def"), (s1: "3x", s2: ""), (s1: "3x", s2: ""), (s1: "3x", s2: ""), (s1: "3x", s2: ""), (s1: "lastone", s2: "")]'''
  3. matrix: "--gc:arc"
  4. targets: "c cpp"
  5. """
  6. # bug #13240
  7. type
  8. Thing = object
  9. s1: string
  10. s2: string
  11. var box: seq[Thing]
  12. const c = [Thing(s1: "333"), Thing(s1: "abc", s2: "def")]
  13. for i in 0..high(c):
  14. box.add c[i]
  15. for i in 0..3:
  16. box.add Thing(s1: "3x")
  17. box.add Thing(s1: "lastone")
  18. echo box