diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2020-07-23 16:53:07 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2020-07-23 20:27:17 +0200 |
commit | c90c53e8bb93c99a323684d73df7e7ec4791107d (patch) | |
tree | ca67f5fb4618bedbd08c74dc234acb0d4db9c417 /tests/arc/tarcmisc.nim | |
parent | 14d16c2174a4fcefd405f8c4eeaf57a6dcd2731d (diff) | |
download | Nim-c90c53e8bb93c99a323684d73df7e7ec4791107d.tar.gz |
fixes #15044 [backport:1.2]
Diffstat (limited to 'tests/arc/tarcmisc.nim')
-rw-r--r-- | tests/arc/tarcmisc.nim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/arc/tarcmisc.nim b/tests/arc/tarcmisc.nim index 51c80c348..cb889db15 100644 --- a/tests/arc/tarcmisc.nim +++ b/tests/arc/tarcmisc.nim @@ -23,6 +23,7 @@ whiley ends :( 0 new line before - @['a'] new line after - @['a'] +finalizer closed destroying variable: 20 destroying variable: 10 @@ -258,6 +259,23 @@ newline.insert(indent, 0) echo "new line after - ", newline +# bug #15044 + +type + Test = ref object + +proc test: Test = + # broken + new(result, proc(x: Test) = + echo "finalizer" + ) + +proc tdirectFinalizer = + discard test() + +tdirectFinalizer() + + # bug #14480 proc hello(): int = result = 42 |