fixes mitems iterator on vm. (issue with tuple value)

this discard any implicit conversion on iterator return value.
the previous behaviour was to return a reference to a converted copy and
thus not modifying the original value.
This commit is contained in:
Parashurama
2017-08-10 19:22:00 +02:00
committed by Andreas Rumpf
parent 7ad115f530
commit 03b11b66cf

View File

@@ -1489,6 +1489,9 @@ proc semYieldVarResult(c: PContext, n: PNode, restype: PType) =
var t = skipTypes(restype, {tyGenericInst, tyAlias})
case t.kind
of tyVar:
if n.sons[0].kind in {nkHiddenStdConv, nkHiddenSubConv}:
n.sons[0] = n.sons[0].sons[1]
n.sons[0] = takeImplicitAddr(c, n.sons[0])
of tyTuple:
for i in 0.. <t.sonsLen: