teval1.nim 361 B

12345678910111213141516171819202122232425262728
  1. discard """
  2. nimout: "##"
  3. """
  4. import macros
  5. proc testProc: string {.compileTime.} =
  6. result = ""
  7. result = result & ""
  8. when true:
  9. macro test(n: untyped): untyped =
  10. result = newNimNode(nnkStmtList)
  11. echo "#", testProc(), "#"
  12. test:
  13. "hi"
  14. const
  15. x = testProc()
  16. doAssert x == ""
  17. # bug #1310
  18. static:
  19. var i, j: set[int8] = {}
  20. var k = i + j