parent
6fffadb7fd
commit
6e3d1dced5
6 changed files with 40 additions and 23 deletions
14
tests/macros/tlineinfo.nim
Normal file
14
tests/macros/tlineinfo.nim
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue