template_pragmas.nim 158 B

12345678910
  1. proc output_x:string {.compileTime.} = "x"
  2. template t =
  3. const x = output_x()
  4. let
  5. bar {.exportc:"bar" & x.} = 100
  6. static:
  7. doAssert(compiles (t()))