bugfix: finally sections are executed before return/break
This commit is contained in:
parent
0a57f662fa
commit
ea2306b301
6 changed files with 64 additions and 2 deletions
21
tests/accept/run/tfinally2.nim
Normal file
21
tests/accept/run/tfinally2.nim
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# 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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue