Infer element type for general multi-dimensional getindex