Is 0309 in the beta of Swift 5.5 / Xcode 13?

I thought proposal 0309 was accepted a while ago, but I am still getting the old "Protocol can only be used as a generic constraint because it has Self or associated type requirements" error when I try to use a simple protocol with associated types as a variable.

protocol P {
    associatedtype A

struct X {
    var p:P ///Protocol 'P' can only be used as a generic constraint because it has Self or associated type requirements

Implementation isn't ready to be merged yet

1 Like

It's too late to bring it into 5.5, as the proposal was only accepted a few weeks before WWDC and the cut off to bring features into 5.5 was passed the month before. Once we merge the implementation, the feature should be available in the next major release (5.6 I presume, likely early next year).


Next year?

Is there a reason it couldn't be added to one of the betas later this summer?

In theory it could be, though the criteria for including changes into a release after the cut-off gets stricter as release get nearer, so as to not destabilize the release, and as a result after the cut-off only low-risk changes or critical bug fixes gets accepted, at least in my experience. The release manager has the final say into what goes into 5.5, so if they decide SE-0309 isn't a high-risk change then we can certainly get it into 5.5. In my opinion, it is better to let it settle in the main branch for a while, as it gives us more time to fix any issues that might arise due to it.



I was hoping to refactor my packages to use this at the same time I refactored them to add the new concurrency stuff.

If the release manager is reading this, please consider adding this to 5.5! I have several projects which have a metric ton of extra boilerplate (or which just can't use PATs) because this is missing. I am guessing I am not the only one...

Terms of Service

Privacy Policy

Cookie Policy