<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="">I don’t really get what you are driving at. If I rework your example so that it runs:<div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class="">//<span style="line-height: normal; font-family: 'Apple Color Emoji';" class="">πŸ’</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class="">protocol<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> A {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span> ring: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">String</span> { <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">get</span> }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class="">//<span style="line-height: normal; font-family: 'Apple Color Emoji';" class="">πŸ””</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class="">protocol<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> B {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span> ring: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">String</span> { <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">get</span> <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">set</span> }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">class</span> X: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">A</span>, <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">B</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span> _ring = <span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"</span><span style="line-height: normal; font-family: 'Apple Color Emoji'; color: rgb(209, 47, 27);" class="">πŸ’</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span> ring: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">String</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">get</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">_ring</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">set</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">self</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">_ring</span> = newValue</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">}</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> x = <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">X</span>()</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span>x<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">as</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>A<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">).</span>ring<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #008400" class="">// </span><span style="line-height: normal; font-family: 'Apple Color Emoji'; color: rgb(0, 132, 0);" class="">πŸ’</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span>x<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">as</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>B<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">).</span>ring<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #008400" class="">// </span><span style="line-height: normal; font-family: 'Apple Color Emoji'; color: rgb(0, 132, 0);" class="">πŸ’</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">x</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">ring</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// <span style="line-height: normal; font-family: 'Apple Color Emoji';" class="">πŸ’</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">x<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">.</span>ring<span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"</span><span style="line-height: normal; font-family: 'Apple Color Emoji'; color: rgb(209, 47, 27);" class="">πŸ””</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">x</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">ring</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span>// <span style="line-height: normal; font-family: 'Apple Color Emoji';" class="">πŸ””</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class="">// (x as A).ring = "<span style="line-height: normal; font-family: 'Apple Color Emoji';" class="">πŸ””</span>" Error, A doesn't have set</div><div class=""><br class=""></div><div class="">Then the behaviour is exactly what I would expect.</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 7 Jan 2016, at 9:18 PM, Grzegorz Leszek via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">I suggest compile warning if one classes/structs/enums implements<br class="">protocols with the same name.<br class="">It could lead to confusions, when methods of those protocols will mean<br class="">different things.<br class="">It will force to implement parent protocol with shared methods or<br class="">change method in one of the protocols.<br class="">Below is an example.<br class="">Regards,<br class="">Greg<br class=""><br class="">//πŸ’<br class="">protocol A {<br class=""> &nbsp;var ring: String { get }<br class="">}<br class=""><br class="">//πŸ””<br class="">protocol B {<br class=""> &nbsp;var ring: String { get set }<br class="">}<br class=""><br class="">class X: A, B {<br class=""> &nbsp;var ring: String {<br class=""> &nbsp;&nbsp;&nbsp;get {<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return "πŸ’"<br class=""> &nbsp;&nbsp;&nbsp;}<br class=""> &nbsp;&nbsp;&nbsp;set {<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.ring = newValue<br class=""> &nbsp;&nbsp;&nbsp;}<br class=""> &nbsp;}<br class="">}<br class="">let x = X()<br class="">let somewhereInTheProject = "\(x.ring) the bell"<br class="">x.ring = "πŸ””" // ERROR!<br class="">_______________________________________________<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></div></blockquote></div><br class=""></div></body></html>