Understanding the protocol with type requirements error
July 23, 2020
So you’re probably here because of this error: protocol 'CustomProtocol' can only be used as a generic constraint because it has Self or associated type requirements
. Or maybe you’re just here because you’ve had this issue before and if you haven’t I’m sure you’ll hit it eventually. For the longest time I didn’t have much understanding of what this error message was telling me. This left me investigating a problem for far longer than I probably should have, so the goal here is to understand what this error is and hopefully get on the road to fixing it faster.