diff options
author | Clyybber <darkmine956@gmail.com> | 2020-07-10 17:02:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-10 17:02:49 +0200 |
commit | b21782a667f7a819124e95da14053387bd0079a0 (patch) | |
tree | 2e45e3f9fc7638023871709ad586da639f3c45dd /tests | |
parent | 229a623849da617abd9afc3f30ba6c612b4c04c2 (diff) | |
download | Nim-b21782a667f7a819124e95da14053387bd0079a0.tar.gz |
Add testcase for #4722 (#14954)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/template/template_issues.nim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/template/template_issues.nim b/tests/template/template_issues.nim index e56d44480..420373e61 100644 --- a/tests/template/template_issues.nim +++ b/tests/template/template_issues.nim @@ -8,6 +8,9 @@ hi Hello, World! (e: 42) hey +foo +foo +foo ''' """ @@ -245,3 +248,21 @@ proc foo(): auto = echo "hey" 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) |