<p dir="auto">I am working with 4/5/6D arrays and I have found so many bugs caused by supplying 4 indexes to a 5D array, which just silently returns an (essentially random) element.</p>
<p dir="auto">I think this should be considered a bug as it is very easy to do by mistake and leads to data corruption.</p>
<p dir="auto">Is this regarded as a feature? What is the reasoning behind it, rather than requiring colons to fill out the missing indexes?</p>
<p dir="auto">There are some aspects of <code class="notranslate">getindex</code>.<br>
Let <code class="notranslate">A</code> is a <code class="notranslate">n</code>-dimensional array, say 4-dimensional with <code class="notranslate">size(A) == (2,3,2,2)</code>,</p>
<ul dir="auto">
<li>Dimensions left out get flattened into the last indexed dimension, so for example<br>
<code class="notranslate">A[i, k]==A[i,:,:,:][k] for k in 1:12</code><br>
This seems to be a consistent generalization of A[:] transforming the array to a vector.</li>
<li>Also additional indexes of the form <code class="notranslate">1</code>, <code class="notranslate">:</code> and equivalent <code class="notranslate">1:1</code> (additional to the <code class="notranslate">n</code> dimensions) can be provided. For example<br>
<code class="notranslate">A[2,3,2,2, 1, 1] ~ Int64  A[2,3,2,2, :, 1] ~ 1x1x1x1x1 Array{Int64,5}</code><br>
(In both cases as usual the trailing integer-indexed dimension are removed)</li>
</ul>
<p dir="auto">Which behaviors are desired, which are artifacts from the implementation, which should be documented?</p>