summary refs log tree commit diff stats
path: root/tests/misc/tinvalidarrayaccess2.nim
blob: 86d34945773c1c825b8f5de99b1b8323ff344d47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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()