refactor illegal iterator assignment detection (#12212)

* refactor illegal iterator assignment detection

* delete crappy test
This commit is contained in:
Arne Döring 2019-10-11 08:43:58 +02:00 • committed by Andreas Rumpf
commit 7cf3395d85
9 changed files with 54 additions and 54 deletions

View file

@ -636,7 +636,7 @@ proc reverseDestroys(destroys: seq[PNode]): seq[PNode] =
result.add destroys[i]
proc injectDestructorCalls*(g: ModuleGraph; owner: PSym; n: PNode): PNode =
if sfGeneratedOp in owner.flags or isInlineIterator(owner): return n
if sfGeneratedOp in owner.flags or (owner.kind == skIterator and isInlineIterator(owner.typ)): return n
var c: Con
c.owner = owner
c.destroys = newNodeI(nkStmtList, n.info)