Update the types consumers of Index and Range (#24036)