Yield error on to_index with non-Real argument

Fixes #6017
Allow Real when scalar-ndexing on 7th+ dimension
Merge pull request #6037 from JuliaLang/cb/index

some indexing tweaks