This commit is contained in:
parent
e2886eebb4
commit
0d8942d45e
7 changed files with 175 additions and 15 deletions
|
|
@ -1,6 +1,10 @@
|
|||
discard """
|
||||
output: '''hi
|
||||
hi'''
|
||||
hi
|
||||
1
|
||||
hi
|
||||
B
|
||||
A'''
|
||||
"""
|
||||
|
||||
# bug #1742
|
||||
|
|
@ -16,3 +20,23 @@ import strutils
|
|||
let x = try: parseInt("133a")
|
||||
except: -1
|
||||
finally: echo "hi"
|
||||
|
||||
|
||||
template atFuncEnd =
|
||||
defer:
|
||||
echo "A"
|
||||
defer:
|
||||
echo "B"
|
||||
|
||||
template testB(): expr =
|
||||
let a = 0
|
||||
defer: echo "hi" # Delete this line to make it work
|
||||
a
|
||||
|
||||
proc main =
|
||||
atFuncEnd()
|
||||
echo 1
|
||||
let i = testB()
|
||||
echo 2
|
||||
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue