<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 19. Jun 2017, at 19:58, Stephen Canon &lt;<a href="mailto:scanon@apple.com" class="">scanon@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><blockquote type="cite" class="">On Jun 19, 2017, at 11:46 AM, Ted F.A. van Gaalen via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></blockquote><div class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">var result: Float = 0.0</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">result = float * integer * uint8 + &nbsp;double &nbsp;&nbsp;</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">// here, all operands should be implicitly promoted to Double before the complete expression evaluation.</div></div></blockquote></div><br class=""><div class="">You would have this produce different results than:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>let temp = float * integer * uint8</div></div></div></blockquote>“temp” &nbsp;is now a Float<br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>result = temp + double</div></div></div></blockquote>“temp" being implicitly converted to a Double before expression evaluation&nbsp;<br class=""><blockquote type="cite" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div></div></blockquote>(assuming the var “result” is still the Float declared in my example)</div><div>after conversion, the expression would be implicitly, type wise &nbsp;</div><div>float = Float( double + double)</div><div><br class=""></div><div>Apart perhaps from small floating point inherent imprecision, I don’t see much difference...</div><div>am I missing something?&nbsp;</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">That would be extremely surprising to many unsuspecting users.</div><div class=""><br class=""></div><div class="">Don’t get me wrong; I *really want* implicit promotions (I proposed one scheme for them &nbsp;way back when Swift was first unveiled publicly). But there’s a lot more subtlety around them than it seems (for example the C and C++ implicit promotion rules can easily be described on a half-sheet of paper, but are the source of *innumerable* bugs). I would rather have no implicit promotions than half-baked implicit promotions.</div><div class=""><br class=""></div></div></div></blockquote><div>I C what you mean. yes, implicit conversion can produce unexpected results, yes.</div><div>Have to be used either with common sense or a lot of debugging or both :o)</div><div>But that’s the case with many programming language features...</div><div>(no debuggers in ca 1980, IDEs are pure luxury :o)</div><div><br class=""></div><div>TedvG&nbsp;</div><div><div class=""><br class=""></div></div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">– Steve</div></div></div></blockquote></div><br class=""></body></html>