summary refs log tree commit diff stats
path: root/tests/destructor/tnewruntime_misc.nim
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-04-26 15:04:52 +0800
committerGitHub <noreply@github.com>2021-04-26 09:04:52 +0200
commit68e522ececdb9f79371f4b60d1fbddcf01736050 (patch)
tree04ebe46e2413693be26d79cce10ceec6d80ae036 /tests/destructor/tnewruntime_misc.nim
parent9e6f2d7d186f760d8eb7dc26c863f23bd044b9c9 (diff)
downloadNim-68e522ececdb9f79371f4b60d1fbddcf01736050.tar.gz
Remove confusing <//> (#17830)
Diffstat (limited to 'tests/destructor/tnewruntime_misc.nim')
-rw-r--r--tests/destructor/tnewruntime_misc.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/destructor/tnewruntime_misc.nim b/tests/destructor/tnewruntime_misc.nim
index 1a5b0e3b0..48ea36b7c 100644
--- a/tests/destructor/tnewruntime_misc.nim
+++ b/tests/destructor/tnewruntime_misc.nim
@@ -25,8 +25,13 @@ putEnv("HEAPTRASHING", "Indeed")
 
 let s1 = getAllocStats()
 
+
+proc newTableOwned[A, B](initialSize = defaultInitialSize): owned(TableRef[A, B]) =
+  new(result)
+  result[] = initTable[A, B](initialSize)
+
 proc main =
-  var w = newTable[string, owned Node]()
+  var w = newTableOwned[string, owned Node]()
   w["key"] = Node(field: "value")
   echo w["key"][]
   echo getEnv("HEAPTRASHING")