diff options
Diffstat (limited to 'tests/macros/macro_bug.nim')
-rw-r--r-- | tests/macros/macro_bug.nim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/macros/macro_bug.nim b/tests/macros/macro_bug.nim index 0d0fa76ac..c723a4ab6 100644 --- a/tests/macros/macro_bug.nim +++ b/tests/macros/macro_bug.nim @@ -1,6 +1,7 @@ import macros -macro macro_bug*(s: stmt): stmt {.immediate.} = +macro macro_bug*(s: untyped) = + echo s.treeRepr s.expectKind({nnkProcDef, nnkMethodDef}) var params = s.params @@ -9,9 +10,9 @@ macro macro_bug*(s: stmt): stmt {.immediate.} = result = newNimNode(nnkProcDef).add( s.name, s[1], genericParams, params, pragma(s), newEmptyNode()) + # don't really do anything var body = body(s) - - # Fails here. - var call = newCall("macro_bug", s.params[1][0]) - body.insert(0, call) result.add(body) + + echo "result:" + echo result.repr |