<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 Feb 21, 2017, at 11:42 PM, David Hart via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class="">If we drop the idea of extending Any and AnyObject (which is out of scope), does the fact that what is left is syntactic sugar make it unsuitable for Swift 4? I remember Chris saying syntactic sugar is not the goal for Swift 4, but this syntactic sugar looks really sweet (pun intended).</div><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div>It’s unlikely we’ll make it a priority to implement anything like that in the Swift 4 timeframe, but PRs are more than welcome ;-)</div><div><br class=""></div><div>Slava</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div class="">On 22 Feb 2017, at 08:36, Douglas Gregor <<a href="mailto:dgregor@apple.com" class="">dgregor@apple.com</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div class=""><br class=""><br class="">Sent from my iPhone</div><div class=""><br class="">On Feb 21, 2017, at 11:25 PM, David Hart via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div class="">Yes, but it's not very discoverable. Plus, if the subclass existentials proposal is accepted, it would actually allow us to do:</div><div class=""><br class=""></div><div class="">class C {}</div><div class="">extension C & P1 {}</div></div></blockquote><div class=""><br class=""></div>... which is <div class=""><br class=""></div><div class="">extension P1 where Self: C1 {}</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Actually extending semantics (e.g. to extend Any or AnyObject) is a very large project that's out of scope. Without that, this is a small bit of syntactic sugar. </div><div class=""><br class=""></div><div class=""> - Doug</div><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">On 22 Feb 2017, at 08:06, Jacob Bandes-Storch <<a href="mailto:jtbandes@gmail.com" class="">jtbandes@gmail.com</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">This works today:<div class=""><br class=""></div><div class=""><div class="">protocol P1{}</div><div class="">protocol P2{}</div><div class=""><br class=""></div><div class="">extension P1 where Self: P2 {</div><div class=""> func foo() {}</div><div class="">}</div><div class=""><br class=""></div><div class="">func bar(x: P1 & P2) {</div><div class=""> x.foo()</div><div class="">}</div></div><div class=""><br class=""></div><div class="gmail_extra">
<br class=""><div class="gmail_quote">On Tue, Feb 21, 2017 at 10:53 PM, David Hart via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class="">Hello list,<div class=""><br class=""></div><div class="">Found out yesterday that you can’t extend all existentials in Swift:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">protocol P1 {}</font></div><div class=""><font face="Menlo" class="">extension P1 {}</font></div><div class=""><font face="Menlo" class="">// works as expected</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">protocol P2 {}</font></div><div class=""><font face="Menlo" class="">extension P1 & P2 {}</font></div><div class=""><font face="Menlo" class="">// error: non-nominal type 'P1 & P2' cannot be extended</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">extension Any {}</font></div><div class=""><font face="Menlo" class="">// error: non-nominal type 'Any' cannot be extended</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">extension AnyObject {}</font></div><div class=""><font face="Menlo" class="">// error: 'AnyObject' protocol cannot be extended</font></div><div class=""><br class=""></div><div class="">I’d like to write a proposal to lift some of those restrictions. But the question is: which should be lifted? <font face="Menlo" class="">P1 & P2</font> seems like an obvious case. But what about <font face="Menlo" class="">Any</font> and <font face="Menlo" class="">AnyObject</font>? Is there a design reason that we shouldn’t allow it?</div><span class="gmail-HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">David.</div></font></span></div><br class="">______________________________<wbr class="">_________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-<wbr class="">evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
</div></blockquote></div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">swift-evolution mailing list</span><br class=""><span class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a></span><br class=""><span class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br class=""></div></blockquote></div></div></blockquote></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>