Unlock Existential Types for All Protocols

Given the Swift goal to promote clarity over brevity, I would prefer having to explicitly mark existentials (at least for protocols having 'Self' or associated type requirements, PATs) with any Protocol instead of simply using Protocol.
Whenever a PAT is placed as an existential, the compiler would let the user choose which fix-it to apply: either using a generic or explicitly marking the protocol as existential with any.

The benefits of having explicit existentials are available in the Clarifiying existential types section of Improving the UI of generics.

13 Likes