summary refs log tree commit diff stats
path: root/tests/macros/tlineinfo.nim
blob: 2ab0e1ee85254d20734ac2b337a0bd007e2efc92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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