diff options
author | Clyybber <darkmine956@gmail.com> | 2020-07-15 11:34:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-15 11:34:10 +0200 |
commit | 08159733cd1ab508a611cf60380572e879ae7f0f (patch) | |
tree | 0547630a5c40af07d07f5fbd1258a16bdb5933c1 /tests/arc | |
parent | c5f64f101b772a1df3ed61c1a2f26a21767b580c (diff) | |
download | Nim-08159733cd1ab508a611cf60380572e879ae7f0f.tar.gz |
Fix #14985 (#14988)
Diffstat (limited to 'tests/arc')
-rw-r--r-- | tests/arc/tmovebug.nim | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/arc/tmovebug.nim b/tests/arc/tmovebug.nim index 424785ed7..3b7a7c5df 100644 --- a/tests/arc/tmovebug.nim +++ b/tests/arc/tmovebug.nim @@ -67,6 +67,9 @@ ho king live long; long live king +hi +try +bye ''' """ @@ -494,3 +497,30 @@ proc weirdScopes = echo king weirdScopes() + + +# bug #14985 +proc getScope(): string = + if true: + return "hi" + else: + "else" + +echo getScope() + +proc getScope3(): string = + try: + "try" + except: + return "except" + +echo getScope3() + +proc getScope2(): string = + case true + of true: + return "bye" + else: + "else" + +echo getScope2() |