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

This commit is contained in:
Andreas Rumpf 2021-08-12 08:25:11 +02:00 • committed by GitHub
commit 018465a234
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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!"