summary refs log blame commit diff stats
path: root/tests/async/t9201.nim
blob: 5aaba70637221b34f6e9cda0bc988569a25fd29e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                            
discard """
  exitcode: 0
"""

# Derived from issue #9201
import asyncdispatch, macros

macro newAsyncProc(name: untyped): untyped =
  expectKind name, nnkStrLit
  let pName = genSym(nskProc, name.strVal)
  result = getAst async quote do:
    proc `pName`() = discard

newAsyncProc("hello")