fixes #5617, 'copyLineInfo' addition (#8523)

This commit is contained in:
andri lim 2018-08-06 04:38:21 +07:00 • committed by Andreas Rumpf
commit 6e3d1dced5
6 changed files with 40 additions and 23 deletions

View file

@ -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