diff options
Diffstat (limited to 'tests/accept/run/tfinally2.nim')
-rw-r--r-- | tests/accept/run/tfinally2.nim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/accept/run/tfinally2.nim b/tests/accept/run/tfinally2.nim new file mode 100644 index 000000000..10d08e816 --- /dev/null +++ b/tests/accept/run/tfinally2.nim @@ -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 + |