summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorParashurama <Rhagdamaziel@ymail.com>2017-08-10 19:22:00 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-08-19 08:58:57 +0200
commit03b11b66cfeed51d56fe45de4d2a761755dba407 (patch)
tree8dfa86f0b8413ce56971e132a7f891f6f1093d91 /compiler
parent7ad115f530942c0fc6718c146ee1a5a97ed61e6f (diff)
downloadNim-03b11b66cfeed51d56fe45de4d2a761755dba407.tar.gz
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.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semexprs.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 291e02505..81799e762 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.. <t.sonsLen: