From 8c4b7129b5b92b6cb56639c7fdf0669f7d13e542 Mon Sep 17 00:00:00 2001 From: metagn Date: Mon, 17 Apr 2023 18:07:09 +0300 Subject: [PATCH] fix small mistake from #21629 (#21672) --- compiler/semtypes.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index d86f5ddb2c..d82748883d 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)