closureiters: fixes #15243 (#15454) [backport:1.2]

* fixes #15243 [backport:1.2]

(cherry picked from commit aa1d7fe1e9)
This commit is contained in:
Andreas Rumpf
2020-10-02 12:38:16 +02:00
committed by narimiran
parent 736e1dd0a0
commit da03b5ca8b
4 changed files with 151 additions and 4 deletions

View File

@@ -0,0 +1,25 @@
discard """
output: '''
finally handler 8
do not duplicate this one
'''
"""
# bug #15243
import asyncdispatch
proc f() {.async.} =
try:
while true:
try:
await sleepAsync(400)
break
finally:
var localHere = 8
echo "finally handler ", localHere
finally:
echo "do not duplicate this one"
when isMainModule:
waitFor f()