summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorTanguy Cizain <tanguycizain@gmail.com>2021-04-15 15:45:38 +0200
committerGitHub <noreply@github.com>2021-04-15 15:45:38 +0200
commit363467fc00d15b274ce963548532cb6330f8b3a5 (patch)
tree65ccc3cca0982865cdbb0a6704438c37c19573f5 /tests
parent51a40c1f38a8a03f745f1982cf74091a1c6f7315 (diff)
downloadNim-363467fc00d15b274ce963548532cb6330f8b3a5.tar.gz
Fix array's high & low return type for empty arrays (#17705)
* fix array.high/low return type

* Add test for empty array low return type

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/array/tarray.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/array/tarray.nim b/tests/array/tarray.nim
index 81a43f203..2765ad06d 100644
--- a/tests/array/tarray.nim
+++ b/tests/array/tarray.nim
@@ -587,3 +587,10 @@ block t12466:
     a[0'u16 + i] = i
   for i in 0'u16 ..< 8'u16:
     a[0'u16 + i] = i
+
+block t17705:
+  # https://github.com/nim-lang/Nim/pull/17705
+  var a = array[0, int].low
+  a = int(a)
+  var b = array[0, int].high
+  b = int(b)