parent
743f2f5faa
commit
1bcc352137
1 changed files with 20 additions and 0 deletions
20
tests/macros/t14847.nim
Normal file
20
tests/macros/t14847.nim
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
discard """
|
||||||
|
output: "98"
|
||||||
|
"""
|
||||||
|
import macros
|
||||||
|
|
||||||
|
#bug #14847
|
||||||
|
proc hello*(b: string) =
|
||||||
|
echo b
|
||||||
|
|
||||||
|
macro dispatch(pro: typed, params: untyped): untyped =
|
||||||
|
var impl = pro.getImpl
|
||||||
|
let id = ident(pro.strVal & "_coverage")
|
||||||
|
impl[0] = id
|
||||||
|
let call = newCall(id, params)
|
||||||
|
|
||||||
|
result = newStmtList()
|
||||||
|
result.add(impl)
|
||||||
|
result.add(call)
|
||||||
|
|
||||||
|
dispatch(hello, "98")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue