<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>That makes sense to me.<br><br><div>-Chris</div></div><div><br>On Dec 11, 2015, at 3:36 PM, Marc Knaup via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Related to this change it would be great when ignoring a closure returned by a function would become a warning instead of an error.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 12, 2015 at 12:26 AM, Douglas Gregor via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><span class=""><div>On Dec 10, 2015, at 4:49 PM, Dmitri Gribenko via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br></span><span class=""><div><div>On Thu, Dec 10, 2015 at 4:47 PM, Adrian Kashivskyy<br>&lt;<a href="mailto:adrian.kashivskyy@me.com" target="_blank">adrian.kashivskyy@me.com</a>&gt; wrote:<br><blockquote type="cite">I'm sure there are plenty of methods in Foundation that return a value which<br>can be ignored. However, as Joe noticed, such functions are generally in<br>minority.<br><br>I'd rather see a couple of `@allow_unused_result` than a dozen of<br>`@warn_unused_result`.<br></blockquote><br>We are interested in seeing the actual data.<br></div></div></span></blockquote></div><div><br></div><div>Indeed, this change has the potential to produce a huge number of warnings that would not be appreciated by the majority of Swift programmers. One can go ahead and hack the Swift compiler fairly easily and go build some apps to see just how often the warning fires. The place to change in the source is in</div><div><br></div><div><span style="white-space:pre-wrap">        </span><a href="https://github.com/apple/swift/blob/master/lib/Sema/TypeCheckDecl.cpp" target="_blank">https://github.com/apple/swift/blob/master/lib/Sema/TypeCheckDecl.cpp</a></div><div><br></div><div>so that we always diagnose calls to non-Void functions. It should be an easy one-off change to gather data.</div><div><br></div><div><span style="white-space:pre-wrap">        </span>- Doug</div><div><br></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=6ZGE61OxINd5lLe2xYh9Ku-2BXbixWNr2nvfzp2IB1sZh1oLdNZKIxFcWdeGVraTTlw3cuUgc6Kp1kyyv37NtVOCYDOqtDb37-2BvAaN7jKmSuJhSmI7fvC4S-2F8XQ67LXCisQAIoPWh75VOzYsP-2FOycTWJQEFDPUdEMWDoJK7NLEujFYfNVSJIssfaevVP-2BOKKP7cdEJ7wzTPHpfBX5MCkKcus4j54HXPpqXl3pYc-2BFTkiA-3D" alt="" width="1" height="1" border="0" 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">
</div>
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=RC5Cq0zAxCHc1sM9Uy3-2BojrrUAw-2F96zH69NULNHPvCtF-2BFjsr6whTmHuRdlpH3lEyMpOiwaGFt4X8xydv-2FWwG2X2JQe4Kd41DYhtMXThoyb6VYa2AU-2FcDWBIPZ-2FJiLfWKEDgu8c2a3-2BP-2BtTt9xUa2bSgLRFLm1wVV6WTZAEBAnFUkh25mmKYYN4EQhaglBOyHz5kIEmQZOFQCLRSTXprNiUgmUbHpbLihLz-2FS8r-2BrhQ-3D" alt="" width="1" height="1" border="0" style="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;">
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>