<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><span></span></div><div>I would say that you kind of already entered a slippery slope when the extension to a protocol can add code / not just declare a behavioural contract and how it changes OOP approach (hence: <a href="https://bugs.swift.org/plugins/servlet/mobile#issue/SR-302">https://bugs.swift.org/plugins/servlet/mobile#issue/SR-302</a> and <a href="https://bugs.swift.org/browse/SR-103">https://bugs.swift.org/browse/SR-103</a> and <a href="https://bugs.swift.org/plugins/servlet/mobile#issue/SR-584">https://bugs.swift.org/plugins/servlet/mobile#issue/SR-584</a>)</div><div><br></div><div>References:</div><div><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);"><a href="https://nomothetis.svbtle.com/the-ghost-of-swift-bugs-future">https://nomothetis.svbtle.com/the-ghost-of-swift-bugs-future</a> </span></font></div><div><a href="https://www.raizlabs.com/dev/2016/12/swift-method-dispatch/" style="background-color: rgba(255, 255, 255, 0);">https://www.raizlabs.com/dev/2016/12/swift-method-dispatch</a></div><div><br></div><div><div id="AppleMailSignature">Sent from my iPhone</div><div><br>On 5 Nov 2017, at 01:08, Slava Pestov <<a href="mailto:spestov@apple.com">spestov@apple.com</a>> wrote:<br><br></div><blockquote type="cite"><div><span></span><br><span></span><br><blockquote type="cite"><span>On Nov 4, 2017, at 1:32 AM, Goffredo Marocchi <<a href="mailto:panajev@gmail.com">panajev@gmail.com</a>> wrote:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Sent from my iPhone</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><blockquote type="cite"><span>On 4 Nov 2017, at 05:26, Slava Pestov via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Protocols define requirements, they don’t “add” things to the conforming type</span><br></blockquote></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>I agree with this, but then this warrants a change for protocol extensions too. Would you be happy with the restriction that default method implementations are only available for value types and not for classes (as structs cannot share code any other way, it is the argument for that I seem to recall)?</span><br></blockquote><span></span><br><span>Protocol extensions are in some sense just syntax sugar for defining new functions. Having a protocol conformance add storage to the conforming type is fundamentally different.</span><br><span></span><br><span>Slava</span><br><span></span><br><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><span></span><br></div></blockquote></div></body></html>