<html><head><meta http-equiv="Content-Type" content="text/html charset=gb2312"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi all,</div><div class=""><br class=""></div><div class="">I think the best way to solve the either problem is to separate it from generic. </div><div class="">Optional and Either shouldn’t work the same way of generic type. </div><div class="">It’s just a represent of multiple type in one location.</div><div class=""><br class=""></div><div class="">Using an old friend, Union in C.</div><div class="">union {</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>case firstType</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>case secondType</div><div class="">}</div><div class=""><br class=""></div><div class="">This is the final solution for the sub typing problem of optional.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">A == union(A,A)</div><div class=""><div class="">union(A,B) == union(B,A)</div></div><div class="">B == union(B,B)</div><div class=""><br class=""></div><div class="">B is subtype of union(A,B)</div><div class="">A is subtype of union(A,B)</div><div class=""><br class=""></div><div class=""><div class="">suppose </div><div class="">a is subclass of A</div><div class="">b is subclass of B, then</div></div><div class=""><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>union(a,B) is subtype of union(A,B)</div><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>union(A,b) is subtype of union(A,B)</div></div><div class=""><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>union(a,b) is subtype of union(a,B)</div></div><div class=""><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>union(a,b) is subtype of union(A,b)</div></div><div class=""><br class=""></div><div class="">union can have as many case as possible. e.g., union(A,B,C,D,…)</div><div class=""><br class=""></div><div class="">So the Optional<UITableView> should be union(UITableView, None)</div><div class="">and Optional<MyTableVIew> should be union(MyTableView, None), which is subclass of union(UITableView, None)</div><div class=""><br class=""></div><div class="">This is a final rational solution. I think.</div><div class=""><br class=""></div><div class="">-Jiannan</div><div><br class=""><blockquote type="cite" class=""><div class="">下面是被转发的邮件:</div><br class="Apple-interchange-newline"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">发件人: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Cao Jiannan via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">主题: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><b class="">[swift-evolution] Swift Generic Subtype Problem</b><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">日期: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">2016年2月16日 GMT+8 11:48:18<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">收件人: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">回复-收件人: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Cao Jiannan <<a href="mailto:frogcjn@163.com" class="">frogcjn@163.com</a>><br class=""></span></div><br class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=gb2312" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><span style="color: rgb(51, 51, 51); font-family: inherit; font-size: 10pt; font-style: inherit;" class=""><br class=""></span></div><span style="color: rgb(51, 51, 51); font-family: inherit; font-size: 10pt; font-style: inherit;" class="">Hi all,</span><br class=""><div class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><span class="" 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" class="" style="font-family: 'Helvetica Neue';">want to discuss on a </font><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue'; font-size: small;" class="">problem</span> about <span style="font-family: 'Helvetica Neue'; color: rgb(51, 51, 51); font-size: small;" class="">optional generic sub-typing.</span></div><div class=""><div class=""><br class=""></div><div class=""><div class="">This is my suggesion.</div><div class=""><br class=""></div></div><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">if B is subclass of A</div><div class="">Either<B,B> is subclass of Either<A,A>, Either<A,B>, Either<B,A></div><div class="">Either<B,A> is subclass of Either<A,A></div><div class=""><div class="">Either<A,B> is subclass of Either<A,A></div><div class=""><br class=""></div></div></div></div></div></div><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""></div><div class=""></div></div></div></div></div></blockquote></div><div class="">Why? Let’s see an example code in a real project:</div><div class=""><br class=""></div><div class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px 0px 0px 6px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px 0px 0px 6px; line-height: normal; font-family: 'Helvetica Neue';" class=""><span style="color: rgb(51, 51, 51); font-family: inherit; font-size: 10pt; font-style: inherit;" class=""><br class=""></span></div><div style="margin: 0px 0px 0px 6px; line-height: normal; font-family: 'Helvetica Neue';" class=""><span style="color: rgb(51, 51, 51); font-family: inherit; font-size: 10pt; font-style: inherit;" class="">Here is a protocol type for some UIViewController,</span></div><div class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class="dp-highlighter" style="box-sizing: border-box; padding: 1px 0px 0px; border: none; font-family: Consolas, 'Courier New', 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 class="bar" style="box-sizing: border-box; margin: 0px; padding: 0px 0px 0px 45px; border: 0px; font-style: inherit; font-family: inherit; vertical-align: baseline;"><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-family: inherit; vertical-align: baseline;"></div></div><ol start="1" class="dp-j" style="box-sizing: border-box; padding: 0px; border: none; font-style: inherit; font-family: inherit; vertical-align: baseline; list-style-position: initial; list-style-image: initial; background-color: rgb(255, 255, 255); color: rgb(92, 92, 92); margin: 0px 0px 1px 45px !important;"><li class="alt" style="box-sizing: border-box; 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; height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; vertical-align: baseline; background-color: inherit; font-size: 9pt !important;">protocol SegueHandlerType { </span></li><li class="" style="box-sizing: border-box; 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); height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; 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 class="alt" style="box-sizing: border-box; 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; height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; vertical-align: baseline; background-color: inherit; font-size: 9pt !important;">} </span></li></ol></div><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-size: 16px; font-family: 'Myriad Set Pro', 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; vertical-align: baseline; line-height: 1.4737em; color: rgb(51, 51, 51);"><br class=""></div><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-size: 16px; font-family: 'Myriad Set Pro', 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; vertical-align: baseline; line-height: 1.4737em; color: rgb(51, 51, 51);"><span class="" style="box-sizing: border-box; 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 class="dp-highlighter" style="box-sizing: border-box; padding: 1px 0px 0px; border: none; font-family: Consolas, 'Courier New', 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 class="bar" style="box-sizing: border-box; margin: 0px; padding: 0px 0px 0px 45px; border: 0px; font-style: inherit; font-family: inherit; vertical-align: baseline;"><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-family: inherit; vertical-align: baseline;"></div></div><ol start="1" class="dp-j" style="box-sizing: border-box; padding: 0px; border: none; font-style: inherit; font-family: inherit; vertical-align: baseline; list-style-position: initial; list-style-image: initial; background-color: rgb(255, 255, 255); color: rgb(92, 92, 92); margin: 0px 0px 1px 45px !important;"><li class="alt" style="box-sizing: border-box; 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; height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; 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 class="" style="box-sizing: border-box; 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); height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; vertical-align: baseline; background-color: inherit; font-size: 9pt !important;">} </span></li></ol></div><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-size: 16px; font-family: 'Myriad Set Pro', 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; vertical-align: baseline; line-height: 1.4737em; color: rgb(51, 51, 51);"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 10pt; font-family: inherit; vertical-align: baseline;"><br class="" style="box-sizing: border-box;"></span></div><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-size: 16px; font-family: 'Myriad Set Pro', 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; vertical-align: baseline; line-height: 1.4737em; color: rgb(51, 51, 51);"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 10pt; font-family: inherit; vertical-align: baseline;">It's great!</span></div><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-size: 16px; font-family: 'Myriad Set Pro', 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; vertical-align: baseline; line-height: 1.4737em; color: rgb(51, 51, 51);"><span class="" style="box-sizing: border-box; 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 class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-size: 16px; font-family: 'Myriad Set Pro', 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; vertical-align: baseline; line-height: 1.4737em; color: rgb(51, 51, 51);"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 10pt; font-family: inherit; vertical-align: baseline;">like:</span></div><div class="dp-highlighter" style="box-sizing: border-box; padding: 1px 0px 0px; border: none; font-family: Consolas, 'Courier New', 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 class="bar" style="box-sizing: border-box; margin: 0px; padding: 0px 0px 0px 45px; border: 0px; font-style: inherit; font-family: inherit; vertical-align: baseline;"><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-family: inherit; vertical-align: baseline;"></div></div><ol start="1" class="dp-j" style="box-sizing: border-box; padding: 0px; border: none; font-style: inherit; font-family: inherit; vertical-align: baseline; list-style-position: initial; list-style-image: initial; background-color: rgb(255, 255, 255); color: rgb(92, 92, 92); margin: 0px 0px 1px 45px !important;"><li class="alt" style="box-sizing: border-box; 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; height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; 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 class="alt" style="box-sizing: border-box; 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; height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; vertical-align: baseline; background-color: inherit; font-size: 9pt !important;">}</span></li><li class="alt" style="box-sizing: border-box; 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; height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; vertical-align: baseline; background-color: inherit; font-size: 9pt !important;"><br class=""></span></li><li class="alt" style="box-sizing: border-box; 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; height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; vertical-align: baseline; background-color: inherit; font-size: 9pt !important;">MyTableViewController { </span></li><li class="" style="box-sizing: border-box; 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); height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; vertical-align: baseline; background-color: inherit; font-size: 9pt !important;"> <span class="annotation" style="box-sizing: border-box; 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 class="" style="box-sizing: border-box; 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 class="" style="box-sizing: border-box; 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); height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; vertical-align: baseline; background-color: inherit; font-size: 9pt !important;">} </span></li></ol></div><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-size: 16px; font-family: 'Myriad Set Pro', 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; vertical-align: baseline; line-height: 1.4737em; color: rgb(51, 51, 51);"><br class=""></div><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-size: 16px; font-family: 'Myriad Set Pro', 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; vertical-align: baseline; line-height: 1.4737em; color: rgb(51, 51, 51);"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-size: 10pt; font-family: inherit; vertical-align: baseline;">Then </span></div><div class="dp-highlighter" style="box-sizing: border-box; padding: 1px 0px 0px; border: none; font-family: Consolas, 'Courier New', 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 class="bar" style="box-sizing: border-box; margin: 0px; padding: 0px 0px 0px 45px; border: 0px; font-style: inherit; font-family: inherit; vertical-align: baseline;"><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-family: inherit; vertical-align: baseline;"></div></div><ol start="1" class="dp-j" style="box-sizing: border-box; padding: 0px; border: none; font-style: inherit; font-family: inherit; vertical-align: baseline; list-style-position: initial; list-style-image: initial; background-color: rgb(255, 255, 255); color: rgb(92, 92, 92); margin: 0px 0px 1px 45px !important;"><li class="alt" style="box-sizing: border-box; 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; height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; 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 class="" style="box-sizing: border-box; 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); height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; vertical-align: baseline; background-color: inherit; font-size: 9pt !important;"> </span></li><li class="alt" style="box-sizing: border-box; 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; height: 12pt; position: relative; white-space: nowrap; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-style: inherit; vertical-align: baseline; background-color: inherit; font-size: 9pt !important;">} </span></li></ol></div><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-size: 16px; font-family: 'Myriad Set Pro', 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; line-height: 1.4737em;"><span style="font-family: Helvetica; font-size: 12px;" class="">will trigger a compiler error.</span><br style="font-family: Helvetica; font-size: 12px;" class=""><span style="font-family: Helvetica; font-size: 12px;" class=""> </span><br style="font-family: Helvetica; font-size: 12px;" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">So the Optional needs a subclass system.</span><br style="font-family: Helvetica; font-size: 12px;" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">Or to say, that the template system needs a subclass system.</span><br style="font-family: Helvetica; font-size: 12px;" class=""><span style="font-family: Helvetica; font-size: 12px;" class=""> </span><br style="font-family: Helvetica; font-size: 12px;" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">Optional<UITableView> should be the super type of Optional<MyTableView></span><br style="font-family: Helvetica; font-size: 12px;" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">Array<UITableView> should be the super type of Array<MyTableView></span></div></div><div class="" style="box-sizing: border-box; margin: 0px; padding: 0px; border: 0px; font-size: 16px; font-family: 'Myriad Set Pro', 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, Verdana, sans-serif; vertical-align: baseline; line-height: 1.4737em; color: rgb(51, 51, 51);"><br class=""></div><div class="" style="box-sizing: border-box; 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" class=""><a href="https://forums.developer.apple.com/message/101646#101646" class="">https://forums.developer.apple.com/message/101646#101646</a></font></div></div></div></div></div></div><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"></div></div></div></div></div></blockquote></div><div class=""><br class=""></div><div class=""><div class=""><br class=""></div></div><div class=""><br class=""></div><div class="">Thanks!</div><div class=""><br class=""></div><div class="">Jiannan, Cao</div><div class=""><br class=""></div><div class=""><br class=""></div></div></div></div></div></div></div></div></div></div><br class=""></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>