fix small mistake from #21629 (#21672)

This commit is contained in:
metagn
2023-04-17 18:07:09 +03:00
committed by GitHub
parent 1af21c2668
commit 8c4b7129b5

View File

@@ -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)