<div dir="ltr">Yes, and I don&#39;t know if there is any particular reason why the == operator for Int doesn&#39;t have @warn_unused_result while the one for Doubles has:<div><br><div><div>func f() { 1 == 2 } // OK</div><div>func g() { 1.0 == 2.0 } // Warning: Result of call &#39;==&#39; is unused</div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 14, 2015 at 7:40 PM, Johan Jensen <span dir="ltr">&lt;<a href="mailto:jj@johanjensen.dk" target="_blank">jj@johanjensen.dk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Because currently only unused variable/constant declarations have warnings/fix-its attached to them.<br></div>There have been some discussion on making <a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001580.html" target="_blank">non-void functions warn of unused results</a> and it’s possible that this would be in style with that.<br>Perhaps (basically) empty statements should also give a warning?<br><br></div>—Johan<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Dec 14, 2015 at 7:08 PM, Jens Persson via swift-dev <span dir="ltr">&lt;<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div>func ok() {</div><div>    let s = &quot;see&quot;; &quot;Why are there exactly &quot;</div><div>    0 == 0 * 42</div><div>    &quot;warnings and errors in this code&quot;</div><div>    let t = s + &quot;?&quot;</div><div>    print(t)</div><div>}</div><div>ok() // see?</div><div><br></div></div>
</div>
</div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=KlmFWKNIEcyPEGx2Wqruu-2FaM6I0anrxIOlKS1pgqec7XjWL7MUftMlhh6AP4DKmBe9FNIPalj-2Banwi9aWZ00mg7yb3bvLaH-2BypHL3fBT46k2mowcTDHefATzPuqqeC0zD3HfnE20kUTTunTesmEOVkWiI1FxyLZ9-2BrpTwBAGOa6yFh4wblggPw9rR-2BQE3L81i85e0kjXuIYp-2FGC496ILm03JBgkTauoEZ3DAf01cLAM-3D" alt="" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" height="1" border="0" width="1">
<br>_______________________________________________<br>
swift-dev mailing list<br>
<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-dev" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">bitCycle AB | Smedjegatan 12 | 742 32 Östhammar | Sweden<br><a href="http://www.bitcycle.com/" target="_blank">http://www.bitcycle.com/</a><br>Phone: +46-73-753 24 62<br>E-mail: <a href="mailto:jens@bitcycle.com" target="_blank">jens@bitcycle.com</a><br><br></div>
</div>