t8535.nim 365 B

123456789101112131415161718192021222324252627282930
  1. discard """
  2. output: '''0
  3. hello'''
  4. """
  5. type
  6. CircAlloc*[Size: static[int], T] = tuple
  7. baseArray: array[Size,T]
  8. index: uint16
  9. type
  10. Job = object of RootObj
  11. var foo {.threadvar.}: CircAlloc[1, Job]
  12. when true:
  13. echo foo.index
  14. # bug #10795
  15. import asyncdispatch
  16. import threadpool
  17. proc f1() =
  18. waitFor sleepAsync(20)
  19. echo "hello"
  20. spawn f1()
  21. sync()