titer11.nim 644 B

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