<div dir="ltr">Sorry if this is already mentioned, but I quite like C#'s "Explicit Interface Implementation" approach:<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><a href="https://msdn.microsoft.com/en-us/library/ms173157.aspx">https://msdn.microsoft.com/en-us/library/ms173157.aspx</a></div></blockquote><br>Basically:<font face="monospace, monospace"><br></font><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"></blockquote></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><span style="font-family:monospace,monospace">var Marriageable.ring: String? { ... }</span><br><font face="monospace, monospace">var CallReceivable.ring: String? { ... }<br><br></font></blockquote><span style="font-family:arial,helvetica,sans-serif">to call it you could do </span><font face="monospace, monospace">self.ring</font><span style="font-family:arial,helvetica,sans-serif"> if it was unambiguous, otherwise:</span><br><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><font face="monospace, monospace"> (self as Marriageable).ring<br></font><span style="font-family:monospace,monospace">(self as </span><span style="font-family:monospace,monospace">CallReceivable</span><span style="font-family:monospace,monospace">).ring</span><font face="monospace, monospace"><br></font></blockquote><font face="monospace, monospace"><br></font></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 11, 2016 at 9:51 AM, Brent Royal-Gordon via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> By giving warning simply for same name, it will be quite annoying when the project run into this situation without any wrong. For example:<br>
><br>
> protocol ForwardIndexType : _Incrementable {<br>
> @warn_unused_result<br>
> public func advancedBy(n: Self.Distance) -> Self<br>
> }<br>
><br>
> extension ForwardIndexType {<br>
> @warn_unused_result<br>
> public func advancedBy(n: Self.Distance) -> Self<br>
> @warn_unused_result<br>
> public func advancedBy(n: Self.Distance, limit: Self) -> Self<br>
> @warn_unused_result<br>
> public func distanceTo(end: Self) -> Self.Distance<br>
> }<br>
><br>
> protocol BidirectionalIndexType : ForwardIndexType<br>
> extension BidirectionalIndexType {<br>
> @warn_unused_result<br>
> public func advancedBy(n: Self.Distance) -> Self<br>
> @warn_unused_result<br>
> public func advancedBy(n: Self.Distance, limit: Self) -> Self<br>
> }<br>
<br>
</span>Firstly, for methods and subscriptors the "name" would actually encompass the entire signature, so `advancedBy(_:)` and `advancedBy(_:limit:)` would not conflict because they have different signatures.<br>
<br>
Secondly, `ForwardIndexType` and `BidirectionalIndexType` are *not* unrelated protocols—one of them conforms to the other. Thus, we can assume that `BidirectionalIndexType` knows about `ForwardIndexType`'s `advancedBy` methods and intends for its versions to have compatible semantics.<br>
<br>
If instead `BidirectionalIndexType` did *not* conform to `ForwardIndexType`, and `RandomAccessIndexType` tried to conform to both `ForwardIndexType` and `BidirectionalIndexType`, *then* we would get an error, because two independent protocols would have declared `advancedBy(_: Self.Distance) -> Self` methods and it's possible they meant for them to have different semantics.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Brent Royal-Gordon<br>
Architechies<br>
<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>