Fix infinite recursion when await is in except body.
This commit is contained in:
parent
edc4940c26
commit
3751019823
3 changed files with 31 additions and 3 deletions
|
|
@ -82,6 +82,15 @@ proc test3(): Future[int] {.async.} =
|
|||
result = 2
|
||||
return
|
||||
|
||||
proc test4(): Future[int] {.async.} =
|
||||
try:
|
||||
discard await foo()
|
||||
raise newException(ValueError, "Test4")
|
||||
except OSError:
|
||||
result = 1
|
||||
except:
|
||||
result = 2
|
||||
|
||||
var x = test()
|
||||
assert x.read
|
||||
|
||||
|
|
@ -90,3 +99,6 @@ assert x.read
|
|||
|
||||
var y = test3()
|
||||
assert y.read == 2
|
||||
|
||||
y = test4()
|
||||
assert y.read == 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue