Open
Description
getting the type of a templated block inside a macro is complicated by the fact that typeof(result.add x)
is NimNode
and not void
Example
import macros
macro foo():untyped =
result = nnkStmtList.newNimNode
var x = nnkDiscardStmt.newTree(newEmptyNode())
let str = result.add x # compiles ???
doAssert str == result # ???
doAssert typeof(result.add x) is NimNode #<= how i found out and what i really care about
foo()
Current Output
asserts all succeed
Expected Output
shouldn't compile; both assertions should fail