summary refs log tree commit diff stats
path: root/tests/parser/tletcolon.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/parser/tletcolon.nim')
-rw-r--r--tests/parser/tletcolon.nim29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/parser/tletcolon.nim b/tests/parser/tletcolon.nim
index 6b86535c8..7eaa5e3e5 100644
--- a/tests/parser/tletcolon.nim
+++ b/tests/parser/tletcolon.nim
@@ -4,7 +4,8 @@ discard """
 44 3
 more body code
 yes
-yes'''
+yes
+block expression works'''
 """
 
 template x(body): untyped =
@@ -32,3 +33,29 @@ let other = x:
     echo "no"
 let outer = y(5):
   echo "yes"
+
+
+# bug #6609
+type
+  TextureInternalFormat = enum RED, RGB, RGBA
+
+const channels = 4
+
+let format =
+    if channels == 1:
+        TextureInternalFormat.RED
+    elif channels == 3:
+        TextureInternalFormat.RGB
+    elif channels == 4:
+        TextureInternalFormat.RGBA
+    else:
+        echo "Texture Format Unknown, assuming RGB"  #This echo causes an error
+        TextureInternalFormat.RGB
+
+# Block as expressions #3827
+block:
+  let x = block:
+    var y = 2
+    echo "block expression works"
+    y*y
+  doAssert x == 4
\ No newline at end of file