thygienictempl.nim 287 B

1234567891011121314151617181920212223
  1. discard """
  2. action: compile
  3. """
  4. var
  5. e = "abc"
  6. raise newException(IOError, e & "ha!")
  7. template t() = echo(foo)
  8. var foo = 12
  9. t()
  10. template test_in(a, b, c: untyped): bool {.dirty.} =
  11. var result {.gensym.}: bool = false
  12. false
  13. when true:
  14. assert test_in(ret2, "test", str_val)