summary refs log tree commit diff stats
path: root/tests/parser
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-11-05 01:25:39 +0100
committerAraq <rumpf_a@web.de>2017-11-05 01:26:04 +0100
commit742f43e57211c22fe1faa0c7ef991b9b0a1eadc9 (patch)
tree46bce5f9cf13f1f6f8dd45fc461615f779deb648 /tests/parser
parent9212aa9c0c7fe29c15485b9e0a841aca8359acfb (diff)
downloadNim-742f43e57211c22fe1faa0c7ef991b9b0a1eadc9.tar.gz
fixes #6609; 'if' expressions support multiple statements; minor breaking change
Diffstat (limited to 'tests/parser')
-rw-r--r--tests/parser/tletcolon.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/parser/tletcolon.nim b/tests/parser/tletcolon.nim
index 6b86535c8..eab7a8edd 100644
--- a/tests/parser/tletcolon.nim
+++ b/tests/parser/tletcolon.nim
@@ -32,3 +32,21 @@ 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