summary refs log tree commit diff stats
path: root/tests/exception/tfinally.nim
blob: aa469d9c03f9daf66764624ff3e2e2adf88eb97d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
discard """
  file: "tfinally.nim"
  output: "came\nhere\n3"
"""
# Test return in try statement:

proc main: int =
  try:
    try:
      return 1
    finally:
      echo("came")
      return 2
  finally:
    echo("here")
    return 3

echo main() #OUT came here 3