Fix `unaliascopy(::SubArray)` with `indices` of `Array{<:CartesianIndex}` (#47779)
This PR fixes the bug caused by the trimming trick.
`Base.index_lengths` is not a proper tool to calculate the trimmed shape
as `indices` might consume more than 1 dim.
And we can avoid the unneeded "`repeat`" when we meet
`Array{CartesianIndex{0}}`
Test added.
Close #47644.