[swift-evolution] Make non-void functions @warn_unused_result by default
dgregor at apple.com
Fri Dec 11 17:26:32 CST 2015
> On Dec 10, 2015, at 4:49 PM, Dmitri Gribenko via swift-evolution <swift-evolution at swift.org> wrote:
> On Thu, Dec 10, 2015 at 4:47 PM, Adrian Kashivskyy
> <adrian.kashivskyy at me.com> wrote:
>> I'm sure there are plenty of methods in Foundation that return a value which
>> can be ignored. However, as Joe noticed, such functions are generally in
>> I'd rather see a couple of `@allow_unused_result` than a dozen of
> We are interested in seeing the actual data.
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
so that we always diagnose calls to non-Void functions. It should be an easy one-off change to gather data.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution