mirror of
https://github.com/nim-lang/Nim.git
synced 2026-09-17 10:34:53 +00:00
fixes #26189
This commit is contained in:
20
tests/exception/t26189.nim
Normal file
20
tests/exception/t26189.nim
Normal file
@@ -0,0 +1,20 @@
|
||||
discard """
|
||||
cmd: "nim c --exceptions:setjmp $file"
|
||||
exitcode: 1
|
||||
output: '''
|
||||
t26189.nim(20) t26189
|
||||
t26189.nim(18) trigger
|
||||
Error: unhandled exception: rollback failed [CatchableError]
|
||||
'''
|
||||
"""
|
||||
|
||||
# Regression test for compiler recursion while generating a raise in finally.
|
||||
proc trigger() =
|
||||
try:
|
||||
discard
|
||||
except Exception as exc:
|
||||
raise exc
|
||||
finally:
|
||||
raise newException(CatchableError, "rollback failed")
|
||||
|
||||
trigger()
|
||||
Reference in New Issue
Block a user