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

Paul Cantrell cantrell at pobox.com
Thu Feb 25 14:46:17 CST 2016


+1 @allow_unused_result

> On Feb 25, 2016, at 2:41 PM, Vanderlei Martinelli via swift-evolution <swift-evolution at swift.org> wrote:
> 
> +1 for the proposal, but I'd like to use `@supress_unused_result_warning`.
> 
> -Van
> 
>> On Thu, Feb 25, 2016 at 2:46 PM, James Hillhouse via swift-evolution <swift-evolution at swift.org> wrote:
>> +1 for the proposal
>> 
>>> On Feb 25, 2016, at 9:46 AM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
>>> 
>>> 
>>> on Wed Feb 24 2016, Janosch Hildebrand <jnosh-AT-jnosh.com> wrote:
>>> 
>>>> 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
>>> 
>>> @no_warn_unused_result would seem to be the least confusable spelling.
>>> @incidental_result would be semantically valid and shorter, but I can't
>>> say I like it.
>>> 
>>>> 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>
>>> 
>>> -- 
>>> -Dave
>>> _______________________________________________
>>> swift-evolution mailing list
>>> swift-evolution at swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-evolution
>> 
>> 
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> 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/3db3b976/attachment.html>


More information about the swift-evolution mailing list