<div style="white-space:pre-wrap">This is the error that gets in my way the most when trying to do protocol oriented programming. It can be super frustrating. That lead me to make a proposal a few weeks back for having generic protocols.<br><br>In that proposal some swift core people expressed that they were keenly aware of said pain. And while they didn't deliver details in time or implementation they expressed that there were efforts ongoing to solve it. </div><br><div class="gmail_quote"><div dir="ltr">On Sun, Dec 13, 2015 at 6:55 PM Marc Knaup via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey guys,<div><br></div><div>I'm looking at Swift 3.0's goal to improve generics.</div><div><br></div><div>Is there any info yet if and how we will be able to refer to instances of protocols that have associated types?</div><div>What is the difficulty in supporting this?</div><div><br></div><div>Simple examples:</div><div><font face="monospace, monospace">var list = [Hashable]()</font></div><div><font face="monospace, monospace">var hashable: Hashable = 2</font></div><div><br></div><div>Right now all we get is</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">protocol 'Hashable' can only be used as a generic constraint because it has Self or associated type requirements</blockquote><div><br></div><div>Thanks,</div><div> Marc</div><div> </div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=RVJ3oK8DhV2nk8GArr3gdELPnoZa5KIhM7Fm9-2Bmn1SvtHTnEi8YJSTU-2FnnYo3HOJlVinPxWLQGOafeK4m2K5cjJFKPxvaV-2Bzxa6fvcpYTA1-2FFWt5oBqdfRMARJtZqHNtYFmsenR-2FD6jZTjEKN2PTgxmyP-2FbBcHC8k7-2BaEQMfM-2B3Ksk-2BZ-2BoLSw37oCbE4PdK8DBvYLYSVPcRFTUuyUaCPkA-3D-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>