tconst_to_sink.nim 480 B

1234567891011121314151617181920212223242526
  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. cmd: "nim c --gc:arc $file"
  4. """
  5. # bug #13240
  6. type
  7. Thing = object
  8. s1: string
  9. s2: string
  10. var box: seq[Thing]
  11. const c = [Thing(s1: "333"), Thing(s1: "abc", s2: "def")]
  12. for i in 0..high(c):
  13. box.add c[i]
  14. for i in 0..3:
  15. box.add Thing(s1: "3x")
  16. box.add Thing(s1: "lastone")
  17. echo box