fixes #18643 [backport:1.0] (#18678)

This commit is contained in:
Andreas Rumpf
2021-08-12 08:25:11 +02:00
committed by GitHub
parent c94933acb7
commit 018465a234
2 changed files with 12 additions and 1 deletions

View File

@@ -594,3 +594,14 @@ block t17705:
a = int(a)
var b = array[0, int].high
b = int(b)
block t18643:
# https://github.com/nim-lang/Nim/issues/18643
let a: array[0, int] = []
var caught = false
let b = 9999999
try:
echo a[b]
except IndexDefect:
caught = true
doAssert caught, "IndexDefect not caught!"