summary refs log tree commit diff stats
path: root/tests/cpp
diff options
context:
space:
mode:
authorcooldome <cdome@bk.ru>2017-12-17 22:56:21 +0000
committerAndreas Rumpf <rumpf_a@web.de>2017-12-17 23:56:21 +0100
commit3659fec72551bd14f893b8eef6ea606a8b929a49 (patch)
tree1c7c06cc212aa9613452fbdf48b7ea745a5b3fbe /tests/cpp
parent69aeb86f49ac39e6a305974840ea5e2abad12717 (diff)
downloadNim-3659fec72551bd14f893b8eef6ea606a8b929a49.tar.gz
Alternative fix for #4910 that covers #6892; fixes #6892 (#6938)
Diffstat (limited to 'tests/cpp')
-rw-r--r--tests/cpp/tget_subsystem.nim14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/cpp/tget_subsystem.nim b/tests/cpp/tget_subsystem.nim
index e9a3fabdd..6fb095a3d 100644
--- a/tests/cpp/tget_subsystem.nim
+++ b/tests/cpp/tget_subsystem.nim
@@ -22,10 +22,18 @@ proc getSubsystem*[T](): ptr T {.
 let input: ptr Input = getSubsystem[Input]()
 
 
-# bug #4910
+# bugs #4910, #6892 
+proc modify(x: var int) = 
+  x = 123
 
 proc foo() =
-  var ts: array[10, int]
+  var ts: array[2, int]
   for t in mitems(ts):
-     t = 123
+    discard
+
+  for t in mitems(ts):
+     modify(t)
+
+  for i, t in mpairs(ts):
+    modify(t)