summary refs log tree commit diff stats
path: root/tests/arc
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2020-07-15 11:34:10 +0200
committerGitHub <noreply@github.com>2020-07-15 11:34:10 +0200
commit08159733cd1ab508a611cf60380572e879ae7f0f (patch)
tree0547630a5c40af07d07f5fbd1258a16bdb5933c1 /tests/arc
parentc5f64f101b772a1df3ed61c1a2f26a21767b580c (diff)
downloadNim-08159733cd1ab508a611cf60380572e879ae7f0f.tar.gz
Fix #14985 (#14988)
Diffstat (limited to 'tests/arc')
-rw-r--r--tests/arc/tmovebug.nim30
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()