Selectdim fails to recognize IndexLinear

I am on the latest master and wondering if the following behaviors considered bugs:

  • selectdim and view returns different types of SubArrays, which is surprising.
  • When N>2 the last type parameter of the returned SubArray is false even if the selection is on the last dimension of the Array. I doubt it will have performance inpact since IndexLinear is useful information for dispatch. Curiously when N=2 selectdim works just fine.
julia> VERSION
julia> x = fill(0., 2,2,2);
julia> typeof(selectdim(x,3,1))
julia> typeof(view(x,:,:,1))

Currently for N-agnostic code I am using

view(x, Base.setindex(ntuple(i->Colon(), N),i,N)...)

But I suppose selectdim(x, N, i) is better style?

Thanks for the report. I’ve filed a fix at

You might also be interested in EllipsisNotation.jl.