teval1.nim 336 B

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