summary refs log tree commit diff stats
path: root/tests/destructor/tnewruntime_misc.nim
diff options
context:
space:
mode:
authorcooldome <cdome@bk.ru>2019-12-10 06:08:46 +0000
committerAndreas Rumpf <rumpf_a@web.de>2019-12-10 07:08:46 +0100
commit13d232ec56c0b9264af5f266f87cc5981bde6c1e (patch)
tree3228c874f43251e23f6b157d3babeeeb6dd3f74e /tests/destructor/tnewruntime_misc.nim
parentc282cee4db7eb02b44a96989c430aa33e5517eab (diff)
downloadNim-13d232ec56c0b9264af5f266f87cc5981bde6c1e.tar.gz
fixes #12827 (#12829) [backport]
Diffstat (limited to 'tests/destructor/tnewruntime_misc.nim')
-rw-r--r--tests/destructor/tnewruntime_misc.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/destructor/tnewruntime_misc.nim b/tests/destructor/tnewruntime_misc.nim
index e6be5824d..025383565 100644
--- a/tests/destructor/tnewruntime_misc.nim
+++ b/tests/destructor/tnewruntime_misc.nim
@@ -7,6 +7,7 @@ axc
 0  new: 0
 ...
 destroying GenericObj[T] GenericObj[system.int]
+test
 '''
 """
 
@@ -117,3 +118,19 @@ proc main12() =
   echo "..."
 
 main12()
+
+#####################################################################
+## bug #12827
+type
+  MyObject = object
+    x: string
+    y: seq[string]
+    needs_ref: ref int
+
+proc xx(xml: string): MyObject =
+  let stream = xml
+  result.x  = xml
+  defer: echo stream
+
+ 
+discard xx("test")