summary refs log tree commit diff stats
path: root/tests/run/tfinally2.nim
blob: 3ed212a7c7044662b43f1e68f514aa4c9a1b4ee7 (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 """
  file: "tfinally2.nim"
  output: "ABCD"
"""
# Test break in try statement:

proc main: int = 
  try:
    block AB:
      try:
        try:
          break AB
        finally:
          stdout.write("A")
        stdout.write("skipped")
      finally: 
        block B:
          stdout.write("B")
      stdout.write("skipped")
    stdout.write("C")
  finally:
    stdout.writeln("D")
    
discard main() #OUT ABCD