Add testcase for #4722 (#14954)

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

View file

@ -8,6 +8,9 @@ hi
Hello, World! Hello, World!
(e: 42) (e: 42)
hey hey
foo
foo
foo
''' '''
""" """
@ -245,3 +248,21 @@ proc foo(): auto =
echo "hey" echo "hey"
discard foo() discard foo()
# bug #4722
type
IteratorF*[In] = iterator() : In {.closure.}
template foof(In: untyped) : untyped =
proc ggg*(arg: IteratorF[In]) =
for i in arg():
echo "foo"
iterator hello() : int {.closure.} =
for i in 1 .. 3:
yield i
foof(int)
ggg(hello)