<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 Oct 13, 2016, at 3:31 PM, Rick Mann via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Would it make sense to be able to specify priority for a set of overloaded methods to help resolve ambiguity?</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote></div><br class=""><div class="">This might be pretty useful in some situations, but I am not sure if the semantic complexity that it introduces is worth it.</div><div class=""><br class=""></div><div class="">Another example of how this could be useful:&nbsp;</div><div class=""><br class=""></div><div class="">I made a bare-bones&nbsp;<a href="https://gist.github.com/hooman/6e08c48e1e06ee19e06e5b09f664f9be" class="">rational number type</a>&nbsp;for Swift a while ago. I would love to be able to overload “/“ operator to create fractions (rational numbers) instead of dividing two integers.&nbsp;</div><div class=""><br class=""></div><div class="">If I overloaded “/“ to return rational (Int / Int -&gt; Rational), the result type of the operator would become ambiguous for every use of it with integer operands. It would be nice if I could prioritize my overload of “/“ over stdlib definition to resolve the ambiguity.&nbsp;</div><div class=""><br class=""></div></body></html>