-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
import macros
proc test(f: var PNimrodNode) {.compileTime.} =
f = newNimNode(nnkStmtList)
f.add newCall(newIdentNode("echo"), newLit(5))
macro blah(prc: stmt): stmt =
result = prc
test(result)
proc test() {.blah.} =
echo 5Traceback (most recent call last)
nimrod.nim(87) nimrod
nimrod.nim(55) handleCmdLine
main.nim(308) mainCommand
main.nim(73) commandCompileToC
modules.nim(193) compileProject
modules.nim(151) compileModule
passes.nim(192) processModule
passes.nim(136) processTopLevelStmt
sem.nim(381) myProcess
sem.nim(355) semStmtAndGenerateGenerics
semstmts.nim(1290) semStmt
semexprs.nim(826) semExprNoType
semexprs.nim(1949) semExpr
semexprs.nim(1542) semWhen
semstmts.nim(1290) semStmt
semexprs.nim(826) semExprNoType
semexprs.nim(2009) semExpr
semstmts.nim(1249) semStmtList
semexprs.nim(2027) semExpr
semstmts.nim(1119) semProc
semstmts.nim(948) semProcAux
semstmts.nim(868) semProcAnnotation
semstmts.nim(1290) semStmt
semexprs.nim(826) semExprNoType
semexprs.nim(1915) semExpr
sem.nim(288) semMacroExpr
vm.nim(1192) evalMacroCall
vm.nim(425) rawExecute
system.nim(2588) failedAssertImpl
system.nim(1855) raiseAssert
Error: unhandled exception: regs[rb].kind == nkRefTy [EAssertionFailed]
Metadata
Metadata
Assignees
Labels
No labels