Mettle

M0105Constant array index out of bounds

Reported by the compiler as an error or warning.

mettle explain M0105

An array is indexed with a compile-time constant that is negative or >= the array length. This would always fault at runtime, so it is a hard error.

Fix: correct the index or the array size. Remember indices are 0-based: the last element of var a: int64[4] is a[3].

Related