<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="">On Dec 4, 2015, at 5:00 PM, Per Melin <<a href="mailto:p@greendale.se" class="">p@greendale.se</a>> wrote:<br class=""><div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><span class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">Xcode "fixes" the last line like this:</div><div class=""><br class=""></div><div class=""> if (a != nil) { }<br class=""></div></div></div></div></div></blockquote><br class=""></div></span><div class="">Huh ok. Out of curiosity, why are you using IUOs for this?</div></div></blockquote><div class=""><br class=""></div><div class=""><div class="">I will leave that question to Amir who created this thread. I try to avoid IUOs altogether. I only found the above when trying to figure out what the heck he was talking about.</div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word" class="">I’m interested in (continuing to ) dramatically reduce the prevalence of IOUs in code (eliminating the need to use them), and reduce their power in various ways. IUOs are one of the biggest sources of surprising behavior in Swift, and while they were a necessary feature to start with, their importance is going down over time.</div></blockquote><div class=""><br class=""></div><div class="">What surprised me was the IIUOs. I did not expect Swift to happily help me shoot myself in the foot quite so easily as this.<br class=""></div><div class=""><br class=""></div><div class=""><div class="">func isNegative(i: Int?) -> Bool {</div><div class=""> return i < 0</div><div class="">}</div></div><div class=""><br class=""></div><div class="">(No, I have never actually written code like this. I can't tell how likely it is that I would make this mistake.)</div></div></div></div></div>
</div></blockquote><br class=""></div><div>This is a separate problem. One of the things we plan to discuss (once things settle down a bit) is how to narrow the implicit conversion from T to T? in cases like this. This implicit promotion, as well as the T <-> T! promotions are problematic in a number of ways, and we need a holistic solution to them. </div><div><br class=""></div><div>We have several specific ideas, but Joe Pamer is driving the effort and he is preoccupied with personal things for the next several weeks.</div><div><br class=""></div><div>-Chris</div><br class=""></body></html>