diff options
Diffstat (limited to 'tests/macros')
-rw-r--r-- | tests/macros/tlineinfo.nim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/macros/tlineinfo.nim b/tests/macros/tlineinfo.nim new file mode 100644 index 000000000..2ab0e1ee8 --- /dev/null +++ b/tests/macros/tlineinfo.nim @@ -0,0 +1,14 @@ +# issue #5617, feature request +# Ability to set a NimNode's lineinfo +import macros + +type + Test = object + +macro mixer(n: typed): untyped = + let x = newIdentNode("echo") + x.copyLineInfo(n) + result = newLit(x.lineInfo == n.lineInfo) + +var z = mixer(Test) +doAssert z |