summary refs log tree commit diff stats
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2023-04-17 18:07:09 +0300
committerGitHub <noreply@github.com>2023-04-17 17:07:09 +0200
commit8c4b7129b5b92b6cb56639c7fdf0669f7d13e542 (patch)
tree52949eb6202d01dd175388c26704fcf03e4653f9
parent1af21c26680ae1251e09852b3a643c31e8f45c21 (diff)
downloadNim-8c4b7129b5b92b6cb56639c7fdf0669f7d13e542.tar.gz
fix small mistake from #21629 (#21672)
-rw-r--r--compiler/semtypes.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index d86f5ddb2..d82748883 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -2059,7 +2059,6 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType =
       # 0 length or empty param list with possible pragmas imply typeclass
       result = newTypeS(tyBuiltInTypeClass, c)
       let child = newTypeS(tyProc, c)
-      var symKind: TSymKind
       if n.kind == nkIteratorTy:
         child.flags.incl tfIterator
       if n.len > 0 and n[1].kind != nkEmpty and n[1].len > 0:
@@ -2072,7 +2071,8 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType =
         pragma(c, s, n[1], {FirstCallConv..LastCallConv})
       result.addSonSkipIntLit(child, c.idgen)
     else:
-      result = semProcTypeWithScope(c, n, prev, skProc)
+      let symKind = if n.kind == nkIteratorTy: skIterator else: skProc
+      result = semProcTypeWithScope(c, n, prev, symKind)
       if n.kind == nkIteratorTy and result.kind == tyProc:
         result.flags.incl(tfIterator)
   of nkEnumTy: result = semEnum(c, n, prev)