t15005.nim 215 B

12345678910111213141516171819
  1. type
  2. T = ref object
  3. data: string
  4. template foo(): T =
  5. var a15005 {.global.}: T
  6. once:
  7. a15005 = T(data: "hi")
  8. a15005
  9. proc test() =
  10. var b15005 = foo()
  11. doAssert b15005.data == "hi"
  12. test()
  13. test()