I was writing some code that makes use of array views and slices, but encountered some inconsistencies.
Why does the following not cause an exception:
a = [1,2]
@show a[3:end]
@show a[4:end]
The above all return empty arrays as expected
But this causes a BoundsError
a = [1,2]
@show a[2:3]
Why is the first index of the slice allowed to be larger than the size of the array itself, but Julia seems to have a problem with the last index being larger than the size?
Julia version: 1.3.1