summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-09-02 15:49:01 +0200
committerGitHub <noreply@github.com>2019-09-02 15:49:01 +0200
commitf8f96d816cdd1a8edc3f1582a76ae483035f6a37 (patch)
tree396ab5cf59d41fd8bf58a63a39e58b5f21c8a334 /tests
parent7ef85db9a9e3df4d6630673ceac33e9fb986e2ed (diff)
parentba18c12005ddbf4859fac3a04ebb149ee20532b0 (diff)
downloadNim-f8f96d816cdd1a8edc3f1582a76ae483035f6a37.tar.gz
sink as lvalue (#12108)
Diffstat (limited to 'tests')
-rw-r--r--tests/destructor/tnewruntime_misc.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/destructor/tnewruntime_misc.nim b/tests/destructor/tnewruntime_misc.nim
index d6c03b9b0..8abf0d30b 100644
--- a/tests/destructor/tnewruntime_misc.nim
+++ b/tests/destructor/tnewruntime_misc.nim
@@ -85,3 +85,16 @@ testWrongAt()
 
 let (a, d) = allocCounters()
 discard cprintf("%ld  new: %ld\n", a - unpairedEnvAllocs() - d, allocs)
+
+#-------------------------------------------------
+type
+  Table[A, B] = object
+    x: seq[(A, B)]
+
+
+proc toTable[A,B](p: sink openArray[(A, B)]): Table[A, B] = 
+  for zz in mitems(p):
+    result.x.add move(zz)
+
+
+let table = {"a": new(int)}.toTable()