[swift-evolution] Make non-void functions @warn_unused_result by default

Janosch Hildebrand jnosh at jnosh.com
Wed Feb 24 17:44:06 CST 2016


Thanks for the encouragement everyone! I’ll start drafting over the weekend.

With regard to the inverted attribute, that is definitely open to discussion.
Other variants that had been mentioned previously include:

@suppress_unused_result - suggested by Adrian Kashivskyy
@allow_unused_result - suggested by Kevin Ballard
@ignoreresult - suggested by Brent Royal-Gordon

Also the aforementioned “Modernizing Attribute Case and Attribute Argument Naming” proposal[1] will also play into this discussion as well.

[1] https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160215/010510.html

- Janosch

> On 24 Feb 2016, at 21:37, Haravikk via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> 
>> On 24 Feb 2016, at 19:27, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> 
>> on Wed Feb 24 2016, Chris Lattner <swift-evolution at swift.org> wrote:
>> 
>>>> On Feb 24, 2016, at 7:13 AM, Janosch Hildebrand via swift-evolution <swift-evolution at swift.org> wrote:
>>>> 
>>>> Erica's proposal about "Modernizing Attribute Case and Attribute Argument Naming" made me remember this discussion.
>>>> 
>>>> I don't think a proposal was ever submitted? If no one else is
>>>> working on a proposal already I would offer myself up for writing
>>>> this up.
>>> 
>>> I don’t recall a real proposal, it would be great for you to drive this.
>> 
>> Yes, please!  I *really* want this change.
> 
> Same!
> 
> The only thing that needs to be considered is what to name the replacement attribute (for methods where the return value isn’t important). I’m thinking @optionalReturn or @ignoreUnusedResult or such.
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160225/cd4c49af/attachment.html>


More information about the swift-evolution mailing list