import chronos
proc p1(a: int) {.async.} =
try: # remove this ok
try:
echo a
await sleepAsync(100) # remove this ok
return # remove this ok
finally:
echo "finally"
except:
discard
proc p2(a: int) {.async.} =
try: # remove this ok
defer:
echo "defer"
await sleepAsync(100) # remove this ok
return # remove this ok
except:
discard
when isMainModule:
waitFor p1(10)
waitFor p2(10)
This is the same issue as upstream https://github.com/nim-lang/Nim/issues/19911 cc @Araq @yglukhov