Allow recursive closure iterators (#19939)
This commit is contained in:
parent
2c0aaac304
commit
ce4078acd4
3 changed files with 16 additions and 5 deletions
|
|
@ -886,7 +886,8 @@ proc semOverloadedCallAnalyseEffects(c: PContext, n: PNode, nOrig: PNode,
|
|||
case callee.kind
|
||||
of skMacro, skTemplate: discard
|
||||
else:
|
||||
if callee.kind == skIterator and callee.id == c.p.owner.id:
|
||||
if callee.kind == skIterator and callee.id == c.p.owner.id and
|
||||
not isClosureIterator(c.p.owner.typ):
|
||||
localError(c.config, n.info, errRecursiveDependencyIteratorX % callee.name.s)
|
||||
# error correction, prevents endless for loop elimination in transf.
|
||||
# See bug #2051:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue