From 03b11b66cfeed51d56fe45de4d2a761755dba407 Mon Sep 17 00:00:00 2001 From: Parashurama Date: Thu, 10 Aug 2017 19:22:00 +0200 Subject: [PATCH] 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. --- compiler/semexprs.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 291e025058..81799e7624 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -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..