summary refs log tree commit diff stats
path: root/tests/exception/tdefer1.nim
blob: 61439530a1f349916a7540e4a76caabcef9d65d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
discard """
  output: '''hi
hi'''
"""

# bug #1742

template test(): expr =
    let a = 0
    defer: echo "hi"
    a

let i = test()

import strutils
let x = try: parseInt("133a")
        except: -1
        finally: echo "hi"