<div dir="ltr">Thanks for the detailed response, very interesting and its helped improve my mental model. I think I may have misinterpreted the extent of the proposal. Good point with CoreGraphics, I was the memory layout rather than the public interface that I was thinking of, but perhaps my memory is out of date :)<div><br></div><div>I think the thing I was remembering is this sort of thing:</div><div><br></div><div><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(187,44,162)">public</span> <span style="color:rgb(187,44,162)">struct</span> _opaque_pthread_t {</p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">    <span style="color:rgb(187,44,162)">public</span> <span style="color:rgb(187,44,162)">var</span> __sig: <span style="color:rgb(112,61,170)">Int</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(112,61,170)"><span style="color:rgb(0,0,0)">    </span><span style="color:rgb(187,44,162)">public</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(187,44,162)">var</span><span style="color:rgb(0,0,0)"> __cleanup_stack: </span>UnsafeMutablePointer<span style="color:rgb(0,0,0)">&lt;</span>__darwin_pthread_handler_rec<span style="color:rgb(0,0,0)">&gt;</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(0,0,0)">    </span><span style="color:rgb(187,44,162)">public</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(187,44,162)">var</span><span style="color:rgb(0,0,0)"> __opaque: (</span><font color="#703daa">Int8</font><span style="color:rgb(0,0,0)">, </span><font color="#703daa">Int8</font><span style="color:rgb(0,0,0)">, </span><font color="#703daa">Int8</font><span style="color:rgb(0,0,0)">, </span><font color="#703daa">Int8</font><span style="color:rgb(0,0,0)">, </span><font color="#703daa">...</font><span style="color:rgb(0,0,0)">))</span></p>
<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo">}</p><p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><br></p>But I think that&#39;s a pthread thing, and probably for fixed sized arrays too. Anyway tuples is for the other thread.<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><br></p>If my assumptions were false and the original idea doesn&#39;t change the memory/performance overhead then I am all for it :)<p style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><br></p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 16, 2016 at 5:24 PM, Slava Pestov <span dir="ltr">&lt;<a href="mailto:spestov@apple.com" target="_blank">spestov@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Feb 15, 2016, at 11:46 PM, Andrew Bennett via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div dir="ltr"><div>The same goes for tuples. At the moment a tuple is the closest thing to a c style struct. I think c structs are currently imported as tuples.</div></div></div></blockquote><div><br></div></span><div>Actually structs are imported as structs :-) (eg, import CoreGraphics - you get a CGPoint struct). We ask clang do the in-memory layout, but from a language perspective, they look mostly like normal Swift structs.</div><span class=""><br><blockquote type="cite"><div><div dir="ltr"><div> If you made it so (A,A) was interchangeable with (B,B) then they&#39;d have to have the same size, and maybe also store type information where they may not otherwise.<br></div></div></div></blockquote><div><br></div></span>That’s not a requirement for subtyping relations actually.</div><div><br></div><div>If A is a struct conforming to some protocol P, then values of type ‘A’ have a different runtime representation than values of type ‘P’, because the protocol value needs to attach the runtime type to the payload, whereas the struct will not. However, we still do an implicit conversion allowing As to be passed as Ps, we just generate the right code at the point where the conversion takes place. </div><div><br></div><div>Another example is when you have a function () -&gt; A, the conversion to () -&gt; P requires actually generating a thunk to wrap the original function value.</div><div><br></div><div>Subtyping in Swift is different from a pointer cast in C — its semantically producing a new value, so any representational change issues are orthogonal to the language itself. They leak out in the cases that are not implemented (we don’t do tuple conversions currently, and didn’t do function conversions until 2.1) but those will get plugged over time.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Slava</div></font></span><div><div class="h5"><div><br></div><div><blockquote type="cite"><div><div dir="ltr"><div><br>On Tuesday, 16 February 2016, Cao Jiannan via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Also:<div><br></div><div>union(A,B,C) is subtype of union(A,B,C,D,…)</div><div><br><div><blockquote type="cite"><div>在 2016年2月16日,14:36,Cao Jiannan &lt;<a>frogcjn@163.com</a>&gt; 写道:</div><br><div><div style="word-wrap:break-word"><div>Hi all,</div><div><br></div><div>I think the best way to solve the either problem is to separate it from generic. </div><div>Optional and Either shouldn’t work the same way of generic type. </div><div>It’s just a represent of multiple type in one location.</div><div><br></div><div>Using an old friend, Union in C.</div><div>union {</div><div><span style="white-space:pre-wrap">        </span>case firstType</div><div><span style="white-space:pre-wrap">        </span>case secondType</div><div>}</div><div><br></div><div>This is the final solution for the sub typing problem of optional.</div><div><br></div><div><br></div><div>A  == union(A,A)</div><div><div>union(A,B) == union(B,A)</div></div><div>B == union(B,B)</div><div><br></div><div>B is subtype of union(A,B)</div><div>A is subtype of union(A,B)</div><div><br></div><div><div>suppose </div><div>a is subclass of A</div><div>b is subclass of B, then</div></div><div><div><span style="white-space:pre-wrap">        </span>union(a,B) is subtype of union(A,B)</div><div><span style="white-space:pre-wrap">        </span>union(A,b) is subtype of union(A,B)</div></div><div><div><span style="white-space:pre-wrap">        </span>union(a,b) is subtype of union(a,B)</div></div><div><div><span style="white-space:pre-wrap">        </span>union(a,b) is subtype of union(A,b)</div></div><div><br></div><div>union can have as many case as possible. e.g., union(A,B,C,D,…)</div><div><br></div><div>So the Optional&lt;UITableView&gt; should be union(UITableView, None)</div><div>and Optional&lt;MyTableVIew&gt; should be union(MyTableView, None), which is subclass of union(UITableView, None)</div><div><br></div><div>This is a final rational solution. I think.</div><div><br></div><div>-Jiannan</div><div><br><blockquote type="cite"><div>下面是被转发的邮件:</div><br><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:-webkit-system-font,&#39;Helvetica Neue&#39;,Helvetica,sans-serif"><b>发件人: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif">Cao Jiannan via swift-evolution &lt;<a>swift-evolution@swift.org</a>&gt;<br></span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:-webkit-system-font,&#39;Helvetica Neue&#39;,Helvetica,sans-serif"><b>主题: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif"><b>[swift-evolution]  Swift Generic Subtype Problem</b><br></span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:-webkit-system-font,&#39;Helvetica Neue&#39;,Helvetica,sans-serif"><b>日期: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif">2016年2月16日 GMT+8 11:48:18<br></span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:-webkit-system-font,&#39;Helvetica Neue&#39;,Helvetica,sans-serif"><b>收件人: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif"><a>swift-evolution@swift.org</a><br></span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:-webkit-system-font,&#39;Helvetica Neue&#39;,Helvetica,sans-serif"><b>回复-收件人: </b></span><span style="font-family:-webkit-system-font,Helvetica Neue,Helvetica,sans-serif">Cao Jiannan &lt;<a>frogcjn@163.com</a>&gt;<br></span></div><br><div><div style="word-wrap:break-word"><div><span style="color:rgb(51,51,51);font-family:inherit;font-size:10pt;font-style:inherit"><br></span></div><span style="color:rgb(51,51,51);font-family:inherit;font-size:10pt;font-style:inherit">Hi all,</span><br><div><div><div style="word-wrap:break-word"><div><span style="font-family:inherit;color:rgb(51,51,51);font-size:10pt;font-style:inherit">I </span><font color="#333333" face="Helvetica Neue" size="2" style="font-family:&#39;Helvetica Neue&#39;">want to discuss on a </font><span style="color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;;font-size:small">problem</span>  about <span style="font-family:&#39;Helvetica Neue&#39;;color:rgb(51,51,51);font-size:small">optional generic sub-typing.</span></div><div><div><br></div><div><div>This is my suggesion.</div><div><br></div></div><div style="word-wrap:break-word"><div><div><div style="word-wrap:break-word"><div>if B is subclass of A</div><div>Either&lt;B,B&gt; is subclass of Either&lt;A,A&gt;, Either&lt;A,B&gt;, Either&lt;B,A&gt;</div><div>Either&lt;B,A&gt; is subclass of Either&lt;A,A&gt;</div><div><div>Either&lt;A,B&gt; is subclass of Either&lt;A,A&gt;</div><div><br></div></div></div></div></div></div><blockquote type="cite"><div style="word-wrap:break-word"><div><div><div style="word-wrap:break-word"><div></div><div></div></div></div></div></div></blockquote></div><div>Why? Let’s see an example code in a real project:</div><div><br></div><div><div><div style="word-wrap:break-word"><div style="margin:0px 0px 0px 6px;line-height:normal"><br></div><div style="margin:0px 0px 0px 6px;line-height:normal;font-family:&#39;Helvetica Neue&#39;"><span style="color:rgb(51,51,51);font-family:inherit;font-size:10pt;font-style:inherit"><br></span></div><div style="margin:0px 0px 0px 6px;line-height:normal;font-family:&#39;Helvetica Neue&#39;"><span style="color:rgb(51,51,51);font-family:inherit;font-size:10pt;font-style:inherit">Here is a protocol type for some UIViewController,</span></div><div><div><div style="word-wrap:break-word"><div><div><div style="word-wrap:break-word"><div><div><div style="word-wrap:break-word"><div><div style="padding:1px 0px 0px;border:none;font-family:Consolas,&#39;Courier New&#39;,Courier,mono,serif;vertical-align:baseline;background-color:rgb(249,249,249);width:auto;overflow:visible;color:rgb(51,51,51);margin:0px!important"><div style="margin:0px;padding:0px 0px 0px 45px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline"><div style="margin:0px;padding:0px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline"></div></div><ol start="1" style="padding:0px;border:none;font-style:inherit;font-family:inherit;vertical-align:baseline;list-style-position:initial;background-color:rgb(255,255,255);color:rgb(92,92,92);margin:0px 0px 1px 45px!important"><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;color:inherit;min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">protocol  SegueHandlerType {  </span></li><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;background-color:rgb(248,248,248);min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">    var tableView: UITableView! { get }  </span></li><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;color:inherit;min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">}  </span></li></ol></div><div style="margin:0px;padding:0px;border:0px;font-size:16px;font-family:&#39;Myriad Set Pro&#39;,&#39;Lucida Grande&#39;,&#39;Helvetica Neue&#39;,Helvetica,Arial,Verdana,sans-serif;vertical-align:baseline;line-height:1.4737em;color:rgb(51,51,51)"><br></div><div style="margin:0px;padding:0px;border:0px;font-size:16px;font-family:&#39;Myriad Set Pro&#39;,&#39;Lucida Grande&#39;,&#39;Helvetica Neue&#39;,Helvetica,Arial,Verdana,sans-serif;vertical-align:baseline;line-height:1.4737em;color:rgb(51,51,51)"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-size:10pt;font-family:inherit;vertical-align:baseline">so the UITableViewController can conform to the protocal</span></div><div style="padding:1px 0px 0px;border:none;font-family:Consolas,&#39;Courier New&#39;,Courier,mono,serif;vertical-align:baseline;background-color:rgb(249,249,249);width:auto;overflow:visible;color:rgb(51,51,51);margin:0px!important"><div style="margin:0px;padding:0px 0px 0px 45px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline"><div style="margin:0px;padding:0px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline"></div></div><ol start="1" style="padding:0px;border:none;font-style:inherit;font-family:inherit;vertical-align:baseline;list-style-position:initial;background-color:rgb(255,255,255);color:rgb(92,92,92);margin:0px 0px 1px 45px!important"><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;color:inherit;min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">extension UITableViewController : SegueHandlerType {  </span></li><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;background-color:rgb(248,248,248);min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">}  </span></li></ol></div><div style="margin:0px;padding:0px;border:0px;font-size:16px;font-family:&#39;Myriad Set Pro&#39;,&#39;Lucida Grande&#39;,&#39;Helvetica Neue&#39;,Helvetica,Arial,Verdana,sans-serif;vertical-align:baseline;line-height:1.4737em;color:rgb(51,51,51)"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-size:10pt;font-family:inherit;vertical-align:baseline"><br></span></div><div style="margin:0px;padding:0px;border:0px;font-size:16px;font-family:&#39;Myriad Set Pro&#39;,&#39;Lucida Grande&#39;,&#39;Helvetica Neue&#39;,Helvetica,Arial,Verdana,sans-serif;vertical-align:baseline;line-height:1.4737em;color:rgb(51,51,51)"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-size:10pt;font-family:inherit;vertical-align:baseline">It&#39;s great!</span></div><div style="margin:0px;padding:0px;border:0px;font-size:16px;font-family:&#39;Myriad Set Pro&#39;,&#39;Lucida Grande&#39;,&#39;Helvetica Neue&#39;,Helvetica,Arial,Verdana,sans-serif;vertical-align:baseline;line-height:1.4737em;color:rgb(51,51,51)"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-size:10pt;font-family:inherit;vertical-align:baseline">What if the tableView is a subclass UITableView?</span></div><div style="margin:0px;padding:0px;border:0px;font-size:16px;font-family:&#39;Myriad Set Pro&#39;,&#39;Lucida Grande&#39;,&#39;Helvetica Neue&#39;,Helvetica,Arial,Verdana,sans-serif;vertical-align:baseline;line-height:1.4737em;color:rgb(51,51,51)"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-size:10pt;font-family:inherit;vertical-align:baseline">like:</span></div><div style="padding:1px 0px 0px;border:none;font-family:Consolas,&#39;Courier New&#39;,Courier,mono,serif;vertical-align:baseline;background-color:rgb(249,249,249);width:auto;overflow:visible;color:rgb(51,51,51);margin:0px!important"><div style="margin:0px;padding:0px 0px 0px 45px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline"><div style="margin:0px;padding:0px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline"></div></div><ol start="1" style="padding:0px;border:none;font-style:inherit;font-family:inherit;vertical-align:baseline;list-style-position:initial;background-color:rgb(255,255,255);color:rgb(92,92,92);margin:0px 0px 1px 45px!important"><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;color:inherit;min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">class MyTableView : UITableView {</span></li><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;color:inherit;min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">}</span></li><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;color:inherit;min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important"><br></span></li><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;color:inherit;min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">MyTableViewController {  </span></li><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;background-color:rgb(248,248,248);min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">      <span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;color:rgb(100,100,100);background-color:inherit;font-size:9pt!important">@IBOutlet</span><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important"> var tableView: MyTableView!  </span></span></li><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;background-color:rgb(248,248,248);min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">}  </span></li></ol></div><div style="margin:0px;padding:0px;border:0px;font-size:16px;font-family:&#39;Myriad Set Pro&#39;,&#39;Lucida Grande&#39;,&#39;Helvetica Neue&#39;,Helvetica,Arial,Verdana,sans-serif;vertical-align:baseline;line-height:1.4737em;color:rgb(51,51,51)"><br></div><div style="margin:0px;padding:0px;border:0px;font-size:16px;font-family:&#39;Myriad Set Pro&#39;,&#39;Lucida Grande&#39;,&#39;Helvetica Neue&#39;,Helvetica,Arial,Verdana,sans-serif;vertical-align:baseline;line-height:1.4737em;color:rgb(51,51,51)"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;font-size:10pt;font-family:inherit;vertical-align:baseline">Then </span></div><div style="padding:1px 0px 0px;border:none;font-family:Consolas,&#39;Courier New&#39;,Courier,mono,serif;vertical-align:baseline;background-color:rgb(249,249,249);width:auto;overflow:visible;color:rgb(51,51,51);margin:0px!important"><div style="margin:0px;padding:0px 0px 0px 45px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline"><div style="margin:0px;padding:0px;border:0px;font-style:inherit;font-family:inherit;vertical-align:baseline"></div></div><ol start="1" style="padding:0px;border:none;font-style:inherit;font-family:inherit;vertical-align:baseline;list-style-position:initial;background-color:rgb(255,255,255);color:rgb(92,92,92);margin:0px 0px 1px 45px!important"><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;color:inherit;min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">extension MyTableViewController:SegueHandlerType {  </span></li><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;background-color:rgb(248,248,248);min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">  </span></li><li style="border-left-width:3px;border-style:none none none solid;border-left-color:rgb(255,255,255);font-style:inherit;font-size:1em;font-family:inherit;vertical-align:baseline;line-height:12pt;list-style:decimal-leading-zero outside;color:inherit;min-height:12pt;white-space:nowrap;margin:0px!important;padding:0px 3px 0px 10px!important"><span style="margin:0px;padding:0px;border:0px;font-style:inherit;vertical-align:baseline;background-color:inherit;font-size:9pt!important">}  </span></li></ol></div><div style="margin:0px;padding:0px;border:0px;font-size:16px;font-family:&#39;Myriad Set Pro&#39;,&#39;Lucida Grande&#39;,&#39;Helvetica Neue&#39;,Helvetica,Arial,Verdana,sans-serif;line-height:1.4737em"><span style="font-family:Helvetica;font-size:12px">will trigger a compiler error.</span><br style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica;font-size:12px"> </span><br style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica;font-size:12px">So the Optional needs a subclass system.</span><br style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica;font-size:12px">Or to say, that the template system needs a subclass system.</span><br style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica;font-size:12px"> </span><br style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica;font-size:12px">Optional&lt;UITableView&gt; should be the super type of Optional&lt;MyTableView&gt;</span><br style="font-family:Helvetica;font-size:12px"><span style="font-family:Helvetica;font-size:12px">Array&lt;UITableView&gt; should be the super type of Array&lt;MyTableView&gt;</span></div></div><div style="margin:0px;padding:0px;border:0px;font-size:16px;font-family:&#39;Myriad Set Pro&#39;,&#39;Lucida Grande&#39;,&#39;Helvetica Neue&#39;,Helvetica,Arial,Verdana,sans-serif;vertical-align:baseline;line-height:1.4737em;color:rgb(51,51,51)"><br></div><div style="margin:0px;padding:0px;border:0px;vertical-align:baseline;line-height:1.4737em"><font color="#333333" face="Myriad Set Pro, Lucida Grande, Helvetica Neue, Helvetica, Arial, Verdana, sans-serif" size="3"><a href="https://forums.developer.apple.com/message/101646#101646" target="_blank">https://forums.developer.apple.com/message/101646#101646</a></font></div></div></div></div></div></div><blockquote type="cite"><div><div style="word-wrap:break-word"><div><div><div style="word-wrap:break-word"></div></div></div></div></div></blockquote></div><div><br></div><div><div><br></div></div><div><br></div><div>Thanks!</div><div><br></div><div>Jiannan, Cao</div><div><br></div><div><br></div></div></div></div></div></div></div></div></div></div><br></div>_______________________________________________<br>swift-evolution mailing list<br><a>swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div></div></blockquote></div>
</div>
_______________________________________________<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" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div></div></div></blockquote></div><br></div>