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

proc main: int = 
  try:
    try:
      return 1
    finally:
      stdout.write("came ")
      return 2
  finally: 
    stdout.write("here ")
    return 3
    
echo main() #OUT came here 3