summary refs log tree commit diff stats
path: root/tests/async/tbreak_must_exec_finally.nim
blob: 8780e6149e8f29262c281b079ee1bce7d46d7872 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()