summary refs log tree commit diff stats
path: root/tests/reject
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-01-16 16:22:23 +0100
committerAraq <rumpf_a@web.de>2011-01-16 16:22:23 +0100
commit0f743e01833290e2995756fbd459728b12d833be (patch)
tree57e2e0b3315ba838cf3d616030fd3238a2f71946 /tests/reject
parent07b784373b1701d962f3e089e648838f96ac8947 (diff)
downloadNim-0f743e01833290e2995756fbd459728b12d833be.tar.gz
explicit indices in array literals
Diffstat (limited to 'tests/reject')
-rwxr-xr-xtests/reject/spec.csv1
-rw-r--r--tests/reject/tarraycons.nim17
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/reject/spec.csv b/tests/reject/spec.csv
index a332096b2..f2d38f03b 100755
--- a/tests/reject/spec.csv
+++ b/tests/reject/spec.csv
@@ -3,6 +3,7 @@ tadrdisc.nim;15;for a 'var' type a variable needs to be passed
 tambsym.nim;6;ambiguous identifier
 tambsym2.nim;4;undeclared identifier: 'CreateRGBSurface'
 tambsym3.nim;6;ambiguous identifier
+tarraycons.nim;9;invalid order in array constructor
 tatomic.nim;2;identifier expected, but found 'atomic'
 tbind2.nim;7;ambiguous call
 tbind4.nim;4;undeclared identifier: 'lastId'
diff --git a/tests/reject/tarraycons.nim b/tests/reject/tarraycons.nim
new file mode 100644
index 000000000..1809f8735
--- /dev/null
+++ b/tests/reject/tarraycons.nim
@@ -0,0 +1,17 @@
+
+type
+  TEnum = enum
+    eA, eB, eC, eD, eE, eF
+    
+const
+  myMapping: array[TEnum, array[0..1, int]] = [
+    eA: [1, 2],
+    eC: [3, 4],
+    eB: [5, 6],
+    eD: [0: 8, 1: 9],
+    eE: [0: 8, 9],
+    eF: [2, 1: 9]
+  ]
+
+echo myMapping[eC][1]
+