<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 Dec 15, 2015, at 3:42 PM, Jens Persson via swift-dev <<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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="">Ok thanks, and what about the initial topic of this thread, ie stuff like this:<div class=""><br class=""></div><div class="">func f() {</div><div class=""> 1; "two"; 3.0</div><div class=""> [4, 5]; 6 * 7</div><div class=""> print("No warnings or errors!")</div><div class="">}</div><div class="">f() // No warnings or errors!</div><div class=""><br class=""></div><div class="">Should I file a bug for that too or is this by design / has this been discussed somewhere already?</div></div></div></blockquote><div><br class=""></div><div>There is a discussion on the swift-evolution mailing list about making “@warn_unused_results” semantics the default for all non-void functions. To me, that seems like the cleanest path to address these issues.</div><div><br class=""></div><div>-Chris</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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 class=""><br class=""><div class=""><br class=""></div></div></div><div class="gmail_extra" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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;"><br class=""><div class="gmail_quote">On Tue, Dec 15, 2015 at 11:54 PM, Dave Abrahams<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:dabrahams@apple.com" target="_blank" class="">dabrahams@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><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=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Dec 14, 2015, at 11:04 AM, Jens Persson via swift-dev <<a href="mailto:swift-dev@swift.org" target="_blank" class="">swift-dev@swift.org</a>> wrote:</div><br class=""><div class=""><div dir="ltr" style="font-family: AvenirNext-Regular; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">Yes, and I don't know if there is any particular reason why the == operator for Int doesn't have @warn_unused_result while the one for Doubles has:<div class=""><br class=""><div class=""><div class="">func f() { 1 == 2 } // OK</div><div class="">func g() { 1.0 == 2.0 } // Warning: Result of call '==' is unused</div></div></div></div></div></blockquote><div class=""><br class=""></div></span>That’s an oversight; please file a radar!</div><div class=""><div class="h5"><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra" style="font-family: AvenirNext-Regular; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br class=""><div class="gmail_quote">On Mon, Dec 14, 2015 at 7:40 PM, Johan Jensen<span class=""> </span><span dir="ltr" class=""><<a href="mailto:jj@johanjensen.dk" target="_blank" class="">jj@johanjensen.dk</a>></span><span class=""> </span>wrote:<br class=""><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 dir="ltr" class=""><div class=""><div class="">Because currently only unused variable/constant declarations have warnings/fix-its attached to them.<br class=""></div>There have been some discussion on making<span class=""> </span><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001580.html" target="_blank" class="">non-void functions warn of unused results</a><span class=""> </span>and it’s possible that this would be in style with that.<br class="">Perhaps (basically) empty statements should also give a warning?<br class=""><br class=""></div>—Johan<br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote"><div class=""><div class="">On Mon, Dec 14, 2015 at 7:08 PM, Jens Persson via swift-dev<span class=""> </span><span dir="ltr" class=""><<a href="mailto:swift-dev@swift.org" target="_blank" class="">swift-dev@swift.org</a>></span><span class=""> </span>wrote:<br class=""></div></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 class=""><div class=""><div dir="ltr" class=""><div class=""><div class="">func ok() {</div><div class=""> <span class=""> </span>let s = "see"; "Why are there exactly "</div><div class=""> <span class=""> </span>0 == 0 * 42</div><div class=""> <span class=""> </span>"warnings and errors in this code"</div><div class=""> <span class=""> </span>let t = s + "?"</div><div class=""> <span class=""> </span>print(t)</div><div class="">}</div><div class="">ok() // see?</div><div class=""><br class=""></div></div></div></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=KlmFWKNIEcyPEGx2Wqruu-2FaM6I0anrxIOlKS1pgqec7XjWL7MUftMlhh6AP4DKmBe9FNIPalj-2Banwi9aWZ00mg7yb3bvLaH-2BypHL3fBT46k2mowcTDHefATzPuqqeC0zD3HfnE20kUTTunTesmEOVkWiI1FxyLZ9-2BrpTwBAGOa6yFh4wblggPw9rR-2BQE3L81i85e0kjXuIYp-2FGC496ILm03JBgkTauoEZ3DAf01cLAM-3D" alt="" height="1" border="0" width="1" style="min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span class=""> </span><br class="">_______________________________________________<br class="">swift-dev mailing list<br class=""><a href="mailto:swift-dev@swift.org" target="_blank" class="">swift-dev@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-dev" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-dev</a><br class=""><br class=""></blockquote></div><br class=""></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class=""> </span><br class=""><div class="">bitCycle AB | Smedjegatan 12 | 742 32 Östhammar | Sweden<br class=""><a href="http://www.bitcycle.com/" target="_blank" class="">http://www.bitcycle.com/</a><br class="">Phone: +46-73-753 24 62<br class="">E-mail:<span class=""> </span><a href="mailto:jens@bitcycle.com" target="_blank" class="">jens@bitcycle.com</a><br class=""><br class=""></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=JfMPa-2F7wwZPzsZ3QKA8NjtONIYX4SjbWuUxtpfsTY2ibUAdT4JeAT9A2UznBuNp-2Ftd9xDWYtJJgcGPnXvL-2F9FA-2FTZjAs4YDUHQCOqdlmiUc6R3Bzzszj3Tqx-2B6fl6XQDqPqXuLDJamBRl9KbvpkjwWB1AGtFdJ2yfqnidab3L-2FfDn-2BYOm9cJnaOpfOi5fUo-2BawaJDGJrpv8wZ-2BLqP1qXNBZjCfeZ-2BJui7ParK-2FIdiMs-3D" alt="" width="1" height="1" border="0" style="font-family: AvenirNext-Regular; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; min-height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: AvenirNext-Regular; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;" class=""><span class=""> </span>_______________________________________________</span><br style="font-family: AvenirNext-Regular; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="font-family: AvenirNext-Regular; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;" class="">swift-dev mailing list</span><br style="font-family: AvenirNext-Regular; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><a href="mailto:swift-dev@swift.org" target="_blank" style="font-family: AvenirNext-Regular; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">swift-dev@swift.org</a><br style="font-family: AvenirNext-Regular; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-dev" target="_blank" style="font-family: AvenirNext-Regular; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-dev</a></div></blockquote></div><br class=""></div></div><span class="HOEnZb"><font color="#888888" class=""><div class="">-Dave<div class=""><br class=""></div><br class=""></div><br class=""></font></span></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class="Apple-converted-space"> </span><br class=""><div class="gmail_signature">bitCycle AB | Smedjegatan 12 | 742 32 Östhammar | Sweden<br class=""><a href="http://www.bitcycle.com/" target="_blank" class="">http://www.bitcycle.com/</a><br class="">Phone: +46-73-753 24 62<br class="">E-mail:<span class="Apple-converted-space"> </span><a href="mailto:jens@bitcycle.com" target="_blank" class="">jens@bitcycle.com</a><br class=""><br class=""></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=RC5Cq0zAxCHc1sM9Uy3-2BojrrUAw-2F96zH69NULNHPvCt2PkbO0Bs0srEpY7SKHFfTEW0EkwPSjsxDBnWZcSNII04l1zJbYVDPOCHJhKCo-2BSy-2FIVmOU1L1T8Yo-2BHMqY6PVhv-2BbKTObW-2FIoAqJhVSOrzaHa1n-2FuV5LQuEehBDLQqZ1-2FkW7BP0fBlYUUUawQzYZteiIPoOylLhj-2BsNRT3cXllnZzRKQCY-2FdZOtDkUkVtDu0-3D" alt="" width="1" height="1" border="0" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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=""><span class="Apple-converted-space"> </span>_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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="">swift-dev mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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=""><a href="mailto:swift-dev@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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="">swift-dev@swift.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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=""><a href="https://lists.swift.org/mailman/listinfo/swift-dev" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: 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="">https://lists.swift.org/mailman/listinfo/swift-dev</a></div></blockquote></div><br class=""></body></html>