This commit is contained in:
Andreas Rumpf 2020-03-09 18:12:52 +01:00 • committed by GitHub
commit ec5cef13cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 1 deletions

View file

@ -0,0 +1,39 @@
discard """
output: '''
before
swallowed
before
swallowed B
'''
cmd: "nim c --gc:arc --exceptions:goto $file"
"""
# bug #13599
proc main() =
try:
echo "before"
raise newException(CatchableError, "foo")
except AssertionError:
echo "caught"
echo "after"
try:
main()
except:
echo "swallowed"
proc mainB() =
try:
echo "before"
raise newException(CatchableError, "foo")
# except CatchableError: # would work
except AssertionError:
echo "caught"
except:
raise
echo "after"
try:
mainB()
except:
echo "swallowed B"