t9201.nim 291 B

123456789101112131415
  1. discard """
  2. exitcode: 0
  3. """
  4. # Derived from issue #9201
  5. import asyncdispatch, macros
  6. macro newAsyncProc(name: untyped): untyped =
  7. expectKind name, nnkStrLit
  8. let pName = genSym(nskProc, name.strVal)
  9. result = getAst async quote do:
  10. proc `pName`() = discard
  11. newAsyncProc("hello")