<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div>On Jan 17, 2017, at 22:30, Braeden Profile via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=utf-8">Hello Swift Community!<div class=""><br class=""></div><div class="">I know that I’ve seen this mentioned before, but what with Enhanced Existentials being brought up, I think this is worth mentioning now. What is the plan regarding letting existentials conform to their protocols? Currently, in Swift 3, it is impossible to write code like this:</div><div class=""><pre class="" style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 0.94em; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); border: 1px solid rgb(204, 204, 204); white-space: pre-wrap; word-wrap: break-word; padding: 5px;"><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #008e01" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Updatable</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>{ </span><span style="font-variant-ligatures: no-common-ligatures; color: #008e01" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> update() }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #008e01" class="">struct</span><span style="font-variant-ligatures: no-common-ligatures" class=""> UpdatePool<T: Updatable></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(146, 146, 146);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>{ </span><span style="font-variant-ligatures: no-common-ligatures" class="">/* ... */</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #008e01" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> heterogenousPool = </span><span style="font-variant-ligatures: no-common-ligatures; color: #4a8672" class="">UpdatePool</span><span style="font-variant-ligatures: no-common-ligatures" class=""><</span><span style="font-variant-ligatures: no-common-ligatures; color: #5eaeae" class="">Updatable</span><span style="font-variant-ligatures: no-common-ligatures" class="">>()</span></div></pre><div class="">Error on the last line: “Using ‘Updatable’ as a concrete type conforming to protocol ‘Updatable’ is not supported.”</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Although my most common use case of this behavior has actually been solved (using ‘AnyObject’ as a concrete type conforming to ‘AnyObject’), I wonder why this can’t be extended to any protocol existential (a field which is about to explode, if we succeed in Enhancing them).</div><div class=""><br class=""></div><div class="">What do you guys think?</div></blockquote><br><div>+1, but I <i>think</i> there's a compiler limitation preventing it at the moment.</div><div><br></div><div>- Dave Sweeris </div></body></html>