refs #9880 show index and bound in lots of index out of bounds errors

This commit is contained in:
Timothee Cour 2018-12-06 15:42:44 -08:00
commit f3ecc15a94
9 changed files with 64 additions and 23 deletions

View file

@ -0,0 +1,16 @@
discard """
errormsg: "index out of bounds: (a:0) <= (i:3) <= (b:1) "
line: 9
"""
# Note: merge in tinvalidarrayaccess.nim pending https://github.com/nim-lang/Nim/issues/9906
let a = [1,2]
echo a[3]
when false:
# TOOD: this case is not yet handled, giving: "index out of bounds"
proc fun()=
let a = @[1,2]
echo a[3]
static: fun()