summary refs log tree commit diff stats
path: root/compiler/semstmts.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r--compiler/semstmts.nim10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 5d1990e33..935934962 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -1550,7 +1550,15 @@ proc activate(c: PContext, n: PNode) =
 
 proc maybeAddResult(c: PContext, s: PSym, n: PNode) =
   if s.typ.sons[0] != nil and not isInlineIterator(s):
-    addResult(c, s.typ.sons[0], n.info, s.kind)
+    let resultType =
+      if s.kind == skMacro:
+        if s.typ.sons[0].kind == tyTypeDesc:
+          s.typ.sons[0]
+        else:
+          sysTypeFromName(c.graph, n.info, "NimNode")
+      else:
+        s.typ.sons[0]
+    addResult(c, resultType, n.info, s.kind)
     addResultNode(c, n)
 
 proc canonType(c: PContext, t: PType): PType =