diff options
author | cooldome <ariabushenko@gmail.com> | 2020-11-09 11:26:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-09 12:26:12 +0100 |
commit | 69fe7070250e0dbbcc0fafff4e341d1d805b7d59 (patch) | |
tree | 6d04057432a6fcd0abaa8fc00cf1139064e4f392 /tests | |
parent | d5a0a5dfffcf77e3221e8522e023e5485a2c37cc (diff) | |
download | Nim-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.nim | 29 |
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() + |