summary refs log tree commit diff stats
path: root/tests/iter
diff options
context:
space:
mode:
authorYuriy Glukhov <yglukhov@users.noreply.github.com>2018-09-04 09:18:11 +0300
committerAndreas Rumpf <rumpf_a@web.de>2018-09-04 08:18:11 +0200
commitd2eea9e1c90a406f25626685ed8237aa2e5a18df (patch)
tree1a3f46d0cb35e5a36cee4d142a9e847ef6816655 /tests/iter
parente789acb59b03b250477a84ba6b10fd0391c45b2f (diff)
downloadNim-d2eea9e1c90a406f25626685ed8237aa2e5a18df.tar.gz
Fixes #8851 (#8859)
Diffstat (limited to 'tests/iter')
-rw-r--r--tests/iter/tyieldintry.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/iter/tyieldintry.nim b/tests/iter/tyieldintry.nim
index 6f0acb169..48d05e866 100644
--- a/tests/iter/tyieldintry.nim
+++ b/tests/iter/tyieldintry.nim
@@ -403,5 +403,18 @@ block: # yield in blockexpr
 
   test(it, 1, 2, 3)
 
+block: #8851 
+  type
+    Foo = ref object of RootObj
+  template someFoo(): Foo =
+    var f: Foo
+    yield 1
+    f
+  iterator it(): int {.closure.} =
+    var o: RootRef
+    o = someFoo()
+
+  test(it, 1)
+
 
 echo "ok"