Array access is always bounds checked (at compile-time and at runtime).
This is not true, it is not always checked. For example the code below does not throw a compilation warning or compilation error; but thankfully does panic (error) during runtime.
myarray3 := [?]int{1, 2, 3, 4, 5, 6}
for i in 0 ..= 6 {
fmt.print(myarray3[i], "")
}
Suggest to change Overview sentence to this or something similar:
Array access is bounds checked by default, both at compile-time (with constant indices) and at runtime.
Thanks to Sentient Coffee for the suggested wording tweak!
In the Odin Overview in this section: https://odin-lang.org/docs/overview/#fixed-arrays It states:
This is not true, it is not always checked. For example the code below does not throw a compilation warning or compilation error; but thankfully does panic (error) during runtime.
Suggest to change Overview sentence to this or something similar:
Thanks to Sentient Coffee for the suggested wording tweak!