Can we upcast a PAT?

There is, technically, a way to do this, but it’s kind of a doozy.

The second half of my post here has some links explaining how. The simplest approach is the one by Dave Abrahams.

The basic idea is to make a marker protocol with requirements that mirror the PAT, except instead of using associated types the requirements are generic. Then you make a placeholder generic type that conditionally conforms to the marker protocol when its generic argument conforms to the real protocol.

Notably, Dave’s approach uses a single generic type, with a helper method to do the necessary casting in one place. Then it can conditionally conform to as many marker protocols as you want.