summary refs log tree commit diff stats
path: root/tests/exception/tfinally3.nim
blob: 9053d397d33f1516b4abd8becc14f8d4164ecf9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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()