Add testcase for #13815 (#14956)

This commit is contained in:
Clyybber 2020-07-10 17:31:15 +02:00 • committed by GitHub
commit db6ffeba8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,9 @@ discard """
0 0
1 1
2 2
70''' 70
0
'''
""" """
when true: when true:
@ -139,3 +141,14 @@ iterator filesIt(path: string): auto {.closure.} =
let prefix = path.splitPath[1] let prefix = path.splitPath[1]
for f in files: for f in files:
yield prefix / f 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