[swift-evolution] Make non-void functions @warn_unused_result by default
clattner at apple.com
Fri Dec 11 20:54:38 CST 2015
That makes sense to me.
> On Dec 11, 2015, at 3:36 PM, Marc Knaup via swift-evolution <swift-evolution at swift.org> wrote:
> Related to this change it would be great when ignoring a closure returned by a function would become a warning instead of an error.
>> On Sat, Dec 12, 2015 at 12:26 AM, Douglas Gregor via swift-evolution <swift-evolution at swift.org> wrote:
>>> 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.
>> - Doug
>> swift-evolution mailing list
>> swift-evolution at swift.org
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution