summary refs log tree commit diff stats
path: root/tests/ccgbugs
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-03-05 22:03:26 +0100
committerAraq <rumpf_a@web.de>2015-03-07 15:43:35 +0100
commit4d8cd34c9e2819b244a0739e8d607830dc2fb533 (patch)
tree6130f402ee8b8d5d0e2c00d7bc2fd7b526fcbdc6 /tests/ccgbugs
parent1a9f266e50de51dabd473f51c6cb0a87cc5439ca (diff)
downloadNim-4d8cd34c9e2819b244a0739e8d607830dc2fb533.tar.gz
fixes #794
Diffstat (limited to 'tests/ccgbugs')
-rw-r--r--tests/ccgbugs/tstringslice.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ccgbugs/tstringslice.nim b/tests/ccgbugs/tstringslice.nim
new file mode 100644
index 000000000..66b3bbbe4
--- /dev/null
+++ b/tests/ccgbugs/tstringslice.nim
@@ -0,0 +1,10 @@
+
+# bug #794
+type TRange = range[0..3]
+
+const str = "123456789"
+
+for i in TRange.low .. TRange.high:
+  echo str[i]                          #This works fine
+  echo str[int(i) .. int(TRange.high)] #So does this
+  echo str[i .. TRange.high]           #The compiler complains about this