<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></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 Jan 10, 2018, at 2:19 PM, Rex Fenley &lt;<a href="mailto:rex@remind101.com" class="">rex@remind101.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Have you found anyone else to help on this one? I would like to dive in myself but I don't have any experience with the compiler and not sure about the size of the workload here.</div></div></blockquote><div><br class=""></div><div>Hi Rex, thank you for offering to help! &nbsp;I have not found anyone else to help out on implementation but am still extremely interested in seeing this happen and willing to help out by drafting the proposal, etc.</div><div><br class=""></div><div>Is anyone who is familiar with it able to give Rex an idea of scope and / or willing to help Rex get up to speed?</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Dec 5, 2017 at 3:34 PM, Rex Fenley <span dir="ltr" class="">&lt;<a href="mailto:rex@remind101.com" target="_blank" class="">rex@remind101.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Huge +1, I've asked for this in the past too.<div class=""><br class=""></div><div class="">Have you also found this limitation frustrating?&nbsp;</div><div class="">&nbsp; - Yes</div><div class=""><br class=""></div><div class="">In what contexts?</div><div class="">&nbsp; - APIs that have this requirement and end up enforcing them through runtime type checking and throws. Shows up in some network data mapping code I have that generalizes over Core Data and Realm (and other databases). The protocol implementer must specify the subtype for the raw mapping of JSON and base type for the DB reading/writing layer. Could see this showing up whenever there's a separation of concerns between what business logic belongs to the base type and subtypes of a more generalized system. I could potentially see the same issue showing up in code generalizing the mapping of data to UI, like UITableView/UITableViewCell.</div><div class=""><br class=""></div><div class="">Does anyone have reservations about introducing this capability?<br class=""></div><div class="">&nbsp; - I do not</div><div class=""><div class=""><blockquote type="cite" class="m_-6291591865497663077gmail-m_2306242412896594494clean_bq" style="font-size:12.8px"><div style="word-wrap:break-word" class="">One of the most frequent frustrations I encounter when writing generic code in Swift is the requirement that supertype constraints be concrete.&nbsp; When I mentioned this on Twitter (<a href="https://twitter.com/anandabits/status/929958479598534656" target="_blank" class="">https://twitter.com/anandabit<wbr class="">s/status/929958479598534656</a>) Doug Gregor mentioned that this feature is smaller and mostly straightforward to design and implement (<a href="https://twitter.com/dgregor79/status/929975472779288576" target="_blank" class="">https://twitter.com/dgregor79<wbr class="">/status/929975472779288576</a>).<div class=""><div class=""><br class=""></div><div class="">I currently have a PR open to add the high-level description of this feature found below to the generics manifesto (<a href="https://github.com/apple/swift/pull/13012" target="_blank" class="">https://github.com/apple/swif<wbr class="">t/pull/13012</a>):</div><div class=""><br class=""></div><div class=""><div class="">Currently, supertype constraints may only be specified using a concrete class or protocol type.&nbsp; This prevents us from abstracting over the supertype.</div><div class=""><br class=""></div><div class="">```swift</div><div class="">protocol P {</div><div class="">&nbsp; associatedtype Base</div><div class="">&nbsp; associatedtype Derived: Base</div><div class="">}</div><div class="">```</div><div class=""><br class=""></div><div class="">In the above example `Base` may be any type. &nbsp;`Derived` may be the same as `Base` or may be _any_ subtype of `Base`.&nbsp; All subtype relationships supported by Swift should be supported in this context including, but not limited to, classes and subclasses, existentials and conforming concrete types or refining existentials, `T?` and &nbsp;`T`, `((Base) -&gt; Void)` and `((Derived) -&gt; Void)`, etc.</div><div class=""><br class=""></div><div class="">Generalized supertype constraints would be accepted in all syntactic locations where generic constraints are accepted.</div></div><div class=""><br class=""></div><div class="">I would like to see generalized supertype constraints make it into Swift 5 if possible.&nbsp; I am not an implementer so I will not be able to bring a proposal forward alone but am interested in collaborating with anyone interested in working on implementation.</div><div class=""><br class=""></div><div class="">I am also interested in hearing general feedback on this feature from the community at large.&nbsp; Have you also found this limitation frustrating?&nbsp; In what contexts?&nbsp; Does anyone have reservations about introducing this capability?&nbsp; If so, what are they?<div class=""><br class=""></div><div class=""><div class="">Matthew</div><div class=""><br class=""></div></div></div></div>______________________________<wbr class="">_________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailma<wbr class="">n/listinfo/swift-evolution</a></div></blockquote><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div>-- <br class=""><div class="m_-6291591865497663077gmail_signature"><div dir="ltr" class=""><span class=""><div style="line-height: 1.15; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size:16px;font-family:Arial;background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap" class="">Rex Fenley</span><span style="font-size:16px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap" class=""> &nbsp;</span><span style="font-size:11px;font-family:Arial;color:rgb(153,153,153);background-color:transparent;vertical-align:baseline;white-space:pre-wrap" class="">|</span><span style="line-height:1.15;font-family:Arial;color:rgb(153,153,153);background-color:transparent;vertical-align:baseline;white-space:pre-wrap" class=""> &nbsp;</span><span style="font-size:11px;font-family:Arial;color:rgb(153,153,153);background-color:transparent;vertical-align:baseline;white-space:pre-wrap" class="">IOS DEVELOPER</span><br class=""></div></span><span class=""><br class=""><div style="line-height: 1.15; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size:11px;font-family:Arial;color:rgb(153,153,153);vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class=""><img src="https://lh5.googleusercontent.com/xMgzw3JkFL3DLkdwyq0WxJzKs_XP57gVVCaBMvgi1FKCjSeue0xdx3JZeCWBlxN4KRHhHOfdvJbc1N-AjTwXcKIq4cjJg9H7iaFpQ8WbO4N3c9Y5dzi19cPOs_owPquuqw" width="250px;" height="53px;" style="border:none" class=""></span></div><div style="line-height: 1.15; margin-top: 0pt; margin-bottom: 0pt;" class=""><a href="https://www.remind.com/" style="text-decoration:none" target="_blank" class=""><span style="font-size:11px;font-family:Arial;color:rgb(17,85,204);font-weight:bold;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class="">Remind.com</span></a><span style="font-family:Arial;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class=""> </span><span style="font-size:11px;font-family:Arial;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class="">| &nbsp;</span><a href="http://blog.remind.com/" style="text-decoration:none" target="_blank" class=""><span style="font-size:11px;font-family:Arial;color:rgb(17,85,204);text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class="">BLOG</span></a><span style="font-size:11px;font-family:Arial;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class=""> &nbsp;| &nbsp;</span><a href="https://twitter.com/remindhq" style="text-decoration:none" target="_blank" class=""><span style="font-size:11px;font-family:Arial;color:rgb(17,85,204);text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class="">FOLLOW US</span></a><span style="font-size:11px;font-family:Arial;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class=""> &nbsp;| </span><span style="font-family:Arial;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class="">&nbsp;</span><span style="text-decoration:underline;font-size:11px;font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class=""><a href="https://www.facebook.com/remindhq" style="text-decoration:none" target="_blank" class="">LIKE US</a></span></div></span></div></div>
</font></span></div></div></div>
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><span class=""><div style="line-height: 1.15; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size:16px;font-family:Arial;background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap" class="">Rex Fenley</span><span style="font-size:16px;font-family:Arial;background-color:transparent;vertical-align:baseline;white-space:pre-wrap" class=""> &nbsp;</span><span style="font-size:11px;font-family:Arial;color:rgb(153,153,153);background-color:transparent;vertical-align:baseline;white-space:pre-wrap" class="">|</span><span style="line-height:1.15;font-family:Arial;color:rgb(153,153,153);background-color:transparent;vertical-align:baseline;white-space:pre-wrap" class=""> &nbsp;</span><span style="font-size:11px;font-family:Arial;color:rgb(153,153,153);background-color:transparent;vertical-align:baseline;white-space:pre-wrap" class="">IOS DEVELOPER</span><br class=""></div></span><span class=""><br class=""><div style="line-height: 1.15; margin-top: 0pt; margin-bottom: 0pt;" class=""><span style="font-size:11px;font-family:Arial;color:rgb(153,153,153);vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class=""><img src="https://lh5.googleusercontent.com/xMgzw3JkFL3DLkdwyq0WxJzKs_XP57gVVCaBMvgi1FKCjSeue0xdx3JZeCWBlxN4KRHhHOfdvJbc1N-AjTwXcKIq4cjJg9H7iaFpQ8WbO4N3c9Y5dzi19cPOs_owPquuqw" width="250px;" height="53px;" style="border:none" class=""></span></div><div style="line-height: 1.15; margin-top: 0pt; margin-bottom: 0pt;" class=""><a href="https://www.remind.com/" style="text-decoration:none" target="_blank" class=""><span style="font-size:11px;font-family:Arial;color:rgb(17,85,204);font-weight:bold;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class="">Remind.com</span></a><span style="font-family:Arial;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class=""> </span><span style="font-size:11px;font-family:Arial;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class="">| &nbsp;</span><a href="http://blog.remind.com/" style="text-decoration:none" target="_blank" class=""><span style="font-size:11px;font-family:Arial;color:rgb(17,85,204);text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class="">BLOG</span></a><span style="font-size:11px;font-family:Arial;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class=""> &nbsp;| &nbsp;</span><a href="https://twitter.com/remindhq" style="text-decoration:none" target="_blank" class=""><span style="font-size:11px;font-family:Arial;color:rgb(17,85,204);text-decoration:underline;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class="">FOLLOW US</span></a><span style="font-size:11px;font-family:Arial;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class=""> &nbsp;| </span><span style="font-family:Arial;vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class="">&nbsp;</span><span style="text-decoration:underline;font-size:11px;font-family:Arial;color:rgb(17,85,204);vertical-align:baseline;white-space:pre-wrap;background-color:transparent" class=""><a href="https://www.facebook.com/remindhq" style="text-decoration:none" target="_blank" class="">LIKE US</a></span></div></span></div></div>
</div>
</div></blockquote></div><br class=""></body></html>