diff options
author | Parashurama <Rhagdamaziel@ymail.com> | 2017-08-10 21:01:13 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-08-19 08:58:57 +0200 |
commit | f64eee3a1ebf1cda39160551d0070eada6ed34c9 (patch) | |
tree | c0e3a5062efdbfde8f35a9d8151e00a6734e7942 | |
parent | 03b11b66cfeed51d56fe45de4d2a761755dba407 (diff) | |
download | Nim-f64eee3a1ebf1cda39160551d0070eada6ed34c9.tar.gz |
add testcase for mitems returning tuple on VM.
-rw-r--r-- | tests/vm/tmitems.nim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/vm/tmitems.nim b/tests/vm/tmitems.nim index a77c3fb23..a0e64d6aa 100644 --- a/tests/vm/tmitems.nim +++ b/tests/vm/tmitems.nim @@ -29,3 +29,17 @@ macro m: typed = result.add newCall(bindsym"echo", i) m() + +# bug 4741 & 5013 +proc test() = + var s = [("baz", 42), ("bath", 42)] + for i in s.mitems: + i[1] = 3 + doAssert(s == [("baz", 3), ("bath", 3)]) + +static: + test() + var s = [("baz", 42), ("bath", 42)] + for i in s.mitems: + i[1] = 3 + doAssert(s == [("baz", 3), ("bath", 3)]) |