* fixes #11118

* Reset closure iter exception before rethrowing
This commit is contained in:
Andreas Rumpf 2019-08-17 10:37:38 +02:00 • committed by GitHub
commit db9e27dffd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 14 deletions

View file

@ -5,6 +5,9 @@ bar
Need odd and >= 3 digits##
baz
caught
--------
Triggered raises2
Raising ValueError
'''
"""
@ -45,3 +48,24 @@ try:
finally:
for foobar in strs:
discard
# issue #11118
echo "--------"
proc raises() =
raise newException(ValueError, "Raising ValueError")
proc raises2() =
try:
raises()
except ValueError as e:
echo "Triggered raises2"
raise e
try:
raises2()
except:
echo getCurrentExceptionMsg()
discard
doAssert: getCurrentException() == nil