summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorcooldome <ariabushenko@gmail.com>2020-11-09 11:26:12 +0000
committerGitHub <noreply@github.com>2020-11-09 12:26:12 +0100
commit69fe7070250e0dbbcc0fafff4e341d1d805b7d59 (patch)
tree6d04057432a6fcd0abaa8fc00cf1139064e4f392 /tests
parentd5a0a5dfffcf77e3221e8522e023e5485a2c37cc (diff)
downloadNim-69fe7070250e0dbbcc0fafff4e341d1d805b7d59.tar.gz
Fix 15629 (#15888)
* fix #15858

* fix space

* fix #15629

* Revert "fix space"

* Revert "fix #15858"
Diffstat (limited to 'tests')
-rw-r--r--tests/arc/topt_cursor2.nim29
1 files changed, 27 insertions, 2 deletions
diff --git a/tests/arc/topt_cursor2.nim b/tests/arc/topt_cursor2.nim
index 2e6fb256f..4b566ed24 100644
--- a/tests/arc/topt_cursor2.nim
+++ b/tests/arc/topt_cursor2.nim
@@ -1,6 +1,8 @@
-discard """
-  output: '''emptyemptyempty'''
+discard """  
   cmd: '''nim c --gc:arc $file'''
+  output: '''emptyemptyempty
+inner destroy
+'''
 """
 
 # bug #15039
@@ -49,3 +51,26 @@ proc parse() =
     echo children
 
 parse()
+
+
+#------------------------------------------------------------------------------
+# issue #15629
+
+type inner = object
+type outer = ref inner
+
+proc `=destroy`(b: var inner) =
+  echo "inner destroy"
+
+proc newOuter(): outer =
+  new(result)
+
+type holder = object
+  contents: outer
+
+proc main() = 
+  var t: holder
+  t.contents = newOuter()
+  
+main()
+