What kind of magic behavior is this?

It means Collections that can use Range as their Indices will get Range, not DefaultIndices.

That's how it works now.

And that’s also how it works under my mental model.

Are there any plans or ideas on how we can "improve" associated type inference in the future?

IIRC @Douglas_Gregor had some reasonable ideas about what to do here last year. I spent a few minutes looking for the discussion thread but wasn’t able to find it. If you’re willing to do some digging I’m sure you could find it.

1 Like

I mentioned/linked it above but had not time to re-evaluate it yet.

Yep, that’s the one I was thinking of.