Add testcase for #13815 (#14956)

This commit is contained in:
Clyybber
2020-07-10 17:31:15 +02:00
committed by GitHub
parent 0db32e9885
commit db6ffeba8e

View File

@@ -19,7 +19,9 @@ discard """
0
1
2
70'''
70
0
'''
"""
when true:
@@ -139,3 +141,14 @@ iterator filesIt(path: string): auto {.closure.} =
let prefix = path.splitPath[1]
for f in files:
yield prefix / f
# bug #13815
var love = iterator: int {.closure.} =
yield cast[type(
block:
var a = 0
yield a
a)](0)
for i in love():
echo i