titer11.nim 628 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. discard """
  2. output: '''
  3. [
  4. 1
  5. 2
  6. 3
  7. ]
  8. '''
  9. """
  10. proc represent(i: int): iterator(): string =
  11. result = iterator(): string =
  12. yield $i
  13. proc represent(s: seq[int]): iterator(): string =
  14. result = iterator(): string =
  15. yield "["
  16. for i in s:
  17. var events = represent(i)
  18. for event in events():
  19. yield event
  20. yield "]"
  21. let s = @[1, 2, 3]
  22. var output = represent(s)
  23. for item in output():
  24. echo item
  25. #------------------------------------------------------------------------------
  26. # Issue #12747
  27. type
  28. ABC = ref object
  29. arr: array[0x40000, pointer]
  30. let a = ABC()
  31. for a in a.arr:
  32. assert a == nil