Support iterators returning lent T (#11938)
* lent iterators * rebase tests * update changelog * fix comments, more tests
This commit is contained in:
parent
9ae0dd611f
commit
2b565aad89
7 changed files with 116 additions and 27 deletions
|
|
@ -371,8 +371,7 @@ proc transformYield(c: PTransf, n: PNode): PTransNode =
|
|||
# c.transCon.forStmt.len == 3 means that there is one for loop variable
|
||||
# and thus no tuple unpacking:
|
||||
if e.typ.isNil: return result # can happen in nimsuggest for unknown reasons
|
||||
if skipTypes(e.typ, {tyGenericInst, tyAlias, tySink}).kind == tyTuple and
|
||||
c.transCon.forStmt.len != 3:
|
||||
if c.transCon.forStmt.len != 3:
|
||||
e = skipConv(e)
|
||||
if e.kind in {nkPar, nkTupleConstr}:
|
||||
for i in 0 ..< sonsLen(e):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue