mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-07 12:24:19 +00:00
* fixes #15243 [backport:1.2]
(cherry picked from commit aa1d7fe1e9)
This commit is contained in:
25
tests/async/tbreak_must_exec_finally.nim
Normal file
25
tests/async/tbreak_must_exec_finally.nim
Normal 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()
|
||||
Reference in New Issue
Block a user