summary refs log tree commit diff stats
path: root/tests/macros/tgetimpl.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/macros/tgetimpl.nim')
-rw-r--r--tests/macros/tgetimpl.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/macros/tgetimpl.nim b/tests/macros/tgetimpl.nim
index 398957672..e215d2696 100644
--- a/tests/macros/tgetimpl.nim
+++ b/tests/macros/tgetimpl.nim
@@ -75,7 +75,9 @@ assert: check_gen_proc(len(a)) == (false, true)
 macro check(x: type): untyped =
   let z = getType(x)
   let y = getImpl(z[1])  
-  let sym = if y[0].kind == nnkSym: y[0] else: y[0][0]
+  var sym = y[0]
+  if sym.kind == nnkPragmaExpr: sym = sym[0]
+  if sym.kind == nnkPostfix: sym = sym[1]
   expectKind(z[1], nnkSym)
   expectKind(sym, nnkSym)
   expectKind(y[2], nnkObjectTy)