<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 24, 2017, at 3:16 PM, Jaden Geller &lt;<a href="mailto:jaden.geller@gmail.com" class="">jaden.geller@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 24, 2017, at 2:38 PM, Kevin Nattinger &lt;<a href="mailto:swift@nattinger.net" class="">swift@nattinger.net</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div class=""><br class=""></div><div class="">How can I improve your understanding?</div><br class=""></div></div></blockquote></div><div class=""><br class=""></div>Given the enum I was using earlier:<div class=""><br class=""><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">enum</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Thing {</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="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">case</span><span style="font-variant-ligatures: no-common-ligatures" class=""> thingOne&lt;T&gt;(T)</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="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2" class="">case</span><span style="font-variant-ligatures: no-common-ligatures" class=""> thingTwo&lt;T&gt;(T)</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></div></div><div class=""><br class=""></div><div class="">- Write a function that takes a&nbsp;<span style="font-family: Menlo; font-size: 11px;" class="">thingOne&lt;String&gt; </span>or<span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span style="font-family: Menlo; font-size: 11px;" class="">thingTwo&lt;Int&gt; </span>but nothing else.</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">This isn’t possible since generic types introduced on cases are erased in the type of `Thing`.</div><div class=""><br class=""></div><div class="">We can actually already achieve what you want by moving the generics onto the type itself, and this is already possible in Swift! No new features are necessary.</div><div class=""><br class=""></div><div class="">```</div><div class=""><div style="margin: 0px 0px 0px 31.5px; text-indent: -31.6px; line-height: normal; font-family: Monaco; font-size: 11px;" class=""><span style="color: rgb(201, 0, 164);" class="">enum</span>&nbsp;Thing<span style="color: rgb(200, 0, 164);" class="">&lt;</span>T1, T2<span style="color: rgb(200, 0, 164);" class="">&gt;</span>&nbsp;{</div><div style="margin: 0px 0px 0px 63px; text-indent: -63.1px; line-height: normal; font-family: Monaco; font-size: 11px;" class="">&nbsp; &nbsp;&nbsp;<span style="color: rgb(200, 0, 164);" class="">case</span>&nbsp;thingOne(T1)</div><div style="margin: 0px 0px 0px 63px; text-indent: -63.1px; line-height: normal; font-family: Monaco; font-size: 11px;" class="">&nbsp; &nbsp;&nbsp;<span style="color: rgb(200, 0, 164);" class="">case</span>&nbsp;thingTwo(T2)</div><div style="margin: 0px 0px 0px 31.5px; text-indent: -31.6px; line-height: normal; font-family: Monaco; font-size: 11px;" class="">}</div><div style="margin: 0px 0px 0px 31.5px; text-indent: -31.6px; line-height: normal; font-family: Monaco; min-height: 17px; font-size: 11px;" class=""><br class=""></div><div style="margin: 0px 0px 0px 31.5px; text-indent: -31.6px; line-height: normal; font-family: Monaco; font-size: 11px;" class=""><span style="color: rgb(201, 0, 164);" class="">func</span>&nbsp;test(_ x: Thing<span style="color: rgb(200, 0, 164);" class="">&lt;</span><span style="color: rgb(121, 14, 173);" class="">String</span>,&nbsp;<span style="color: rgb(121, 14, 173);" class="">Int</span><span style="color: rgb(200, 0, 164);" class="">&gt;</span>) {</div><div style="margin: 0px 0px 0px 63px; text-indent: -63.1px; line-height: normal; font-family: Monaco; font-size: 11px;" class="">&nbsp; &nbsp;&nbsp;<span style="color: rgb(200, 0, 164);" class="">switch</span>&nbsp;x {</div><div style="margin: 0px 0px 0px 63px; text-indent: -63.1px; line-height: normal; font-family: Monaco; font-size: 11px;" class="">&nbsp; &nbsp;&nbsp;<span style="color: rgb(200, 0, 164);" class="">case</span>&nbsp;<span style="color: rgb(200, 0, 164);" class="">.</span>thingOne(<span style="color: rgb(201, 0, 164);" class="">let</span>&nbsp;s):</div><div style="margin: 0px 0px 0px 94.6px; text-indent: -94.7px; line-height: normal; font-family: Monaco; color: rgb(223, 0, 2); font-size: 11px;" class=""><span style="" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="color: rgb(69, 0, 132);" class="">print</span><span style="" class="">(</span>"The string has value \(s)!"<span style="" class="">)</span></div><div style="margin: 0px 0px 0px 63px; text-indent: -63.1px; line-height: normal; font-family: Monaco; font-size: 11px;" class="">&nbsp; &nbsp;&nbsp;<span style="color: rgb(200, 0, 164);" class="">case</span>&nbsp;<span style="color: rgb(200, 0, 164);" class="">.</span>thingTwo(<span style="color: rgb(201, 0, 164);" class="">let</span>&nbsp;i):</div><div style="margin: 0px 0px 0px 94.6px; text-indent: -94.7px; line-height: normal; font-family: Monaco; color: rgb(223, 0, 2); font-size: 11px;" class=""><span style="" class="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span style="color: rgb(69, 0, 132);" class="">print</span><span style="" class="">(</span>"The int has value \(i)!"<span style="" class="">)</span></div><div style="margin: 0px 0px 0px 63px; text-indent: -63.1px; line-height: normal; font-family: Monaco; font-size: 11px;" class="">&nbsp; &nbsp;&nbsp;}</div><div style="margin: 0px 0px 0px 31.5px; text-indent: -31.6px; line-height: normal; font-family: Monaco; font-size: 11px;" class="">}</div></div><div class="">```</div></div></div></div></blockquote><div><br class=""></div>Yes, that was almost exactly my original example. My understanding of the proposal is that it will remove that capability, which I find completely unacceptable.</div><div><br class=""></div></body></html>