mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
28 lines
408 B
Nim
28 lines
408 B
Nim
discard """
|
|
outputsub: '''
|
|
false
|
|
Within finally->try
|
|
'''
|
|
exitCode: 1
|
|
"""
|
|
# Test break in try statement:
|
|
|
|
proc main: bool =
|
|
while true:
|
|
try:
|
|
return true
|
|
finally:
|
|
break
|
|
return false
|
|
|
|
echo main() #OUT false
|
|
|
|
# bug #5871
|
|
try:
|
|
raise newException(Exception, "First")
|
|
finally:
|
|
try:
|
|
raise newException(Exception, "Within finally->try")
|
|
except:
|
|
echo getCurrentExceptionMsg()
|