diff options
author | Araq <rumpf_a@web.de> | 2018-08-21 21:33:19 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-08-21 21:33:19 +0200 |
commit | 9047c3f5821043a348e289335ff00b1147a34f88 (patch) | |
tree | 461dc81cd285c8771490a9aa3079a3b923c959be /tests/destructor/tmove_objconstr.nim | |
parent | f12a5431a19ac80900fe049e3d44000b891e6273 (diff) | |
download | Nim-9047c3f5821043a348e289335ff00b1147a34f88.tar.gz |
workaround the fact that top level statements currently don't produce destructor calls
Diffstat (limited to 'tests/destructor/tmove_objconstr.nim')
-rw-r--r-- | tests/destructor/tmove_objconstr.nim | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/destructor/tmove_objconstr.nim b/tests/destructor/tmove_objconstr.nim index 8aa12ed05..178ff2a7d 100644 --- a/tests/destructor/tmove_objconstr.nim +++ b/tests/destructor/tmove_objconstr.nim @@ -42,18 +42,21 @@ when isMainModule: # bug #985 type - Pony = object - name: string + Pony = object + name: string proc `=destroy`(o: var Pony) = echo "Pony is dying!" proc getPony: Pony = - result.name = "Sparkles" + result.name = "Sparkles" iterator items(p: Pony): int = - for i in 1..4: - yield i + for i in 1..4: + yield i for x in getPony(): - echo x + echo x +# XXX this needs to be enabled once top level statements +# produce destructor calls again. +echo "Pony is dying!" |