summary refs log tree commit diff stats
path: root/tests/array
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-02-08 17:18:17 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-02-08 17:18:17 +0100
commit0841c64a3217594d0d260a0f24616b469447c1b9 (patch)
treed16995b64b4cd42b7e3d9adf94dd7f7ff57b600c /tests/array
parentcb9110c43d4ae9c29a0a1e0d54f7735712d4ba62 (diff)
parent444f2231c9b48c34f9bec2ce6cfa3de5ae2560b1 (diff)
downloadNim-0841c64a3217594d0d260a0f24616b469447c1b9.tar.gz
Merge branch 'devel' into araq-quirky-exceptions
Diffstat (limited to 'tests/array')
-rw-r--r--tests/array/tarray.nim12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/array/tarray.nim b/tests/array/tarray.nim
index 2a371b788..b40c8757c 100644
--- a/tests/array/tarray.nim
+++ b/tests/array/tarray.nim
@@ -18,7 +18,7 @@ paper
 @[2, 3, 4]321
 9.0 4.0
 3
-@[(Field0: 1, Field1: 2), (Field0: 3, Field1: 5)]
+@[(1, 2), (3, 5)]
 2
 @["a", "new one", "c"]
 @[1, 2, 3]
@@ -27,6 +27,7 @@ dflfdjkl__abcdefgasfsgdfgsgdfggsdfasdfsafewfkljdsfajs
 dflfdjkl__abcdefgasfsgdfgsgdfggsdfasdfsafewfkljdsfajsdf
 kgdchlfniambejop
 fjpmholcibdgeakn
+2.0
 '''
 joinable: false
 """
@@ -538,3 +539,12 @@ block trelaxedindextyp:
   proc foo(x: seq[int]; idx: uint64) = echo x[idx]
   proc foo(x: string|cstring; idx: uint64) = echo x[idx]
   proc foo(x: openArray[int]; idx: uint64) = echo x[idx]
+
+block t3899:
+  # https://github.com/nim-lang/Nim/issues/3899
+  type O = object
+    a: array[1..2,float]
+  template `[]`(x: O, i: int): float =
+    x.a[i]
+  const c = O(a: [1.0,2.0])
+  echo c[2]