* Fixes #17849 * Update compiler/closureiters.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
parent
4a7f2c386c
commit
a6bd6c7ed8
2 changed files with 21 additions and 1 deletions
|
|
@ -483,5 +483,19 @@ block: # nnkChckRange
|
|||
|
||||
test(it, 1, 2, 3)
|
||||
|
||||
echo "ok"
|
||||
block: #17849 - yield in case subject
|
||||
template yieldInCase: int =
|
||||
yield 2
|
||||
3
|
||||
|
||||
iterator it(): int {.closure.} =
|
||||
yield 1
|
||||
case yieldInCase()
|
||||
of 1: checkpoint(11)
|
||||
of 3: checkpoint(13)
|
||||
else: checkpoint(14)
|
||||
yield 5
|
||||
|
||||
test(it, 1, 2, 13, 5)
|
||||
|
||||
echo "ok"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue