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

Charles Kissinger crk at akkyra.com
Wed Feb 24 22:42:39 CST 2016


> On Feb 24, 2016, at 7:12 PM, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I'd rather have something clear than short.
> 
> Some short ones that haven't been mentioned:
> @Statement has a problem because the result can be used, it's just not mandated. 
> @Statementable just makes no English sense at all (similarly @Procedurable) but kind of communicates the idea
> @ResultDiscardable: not a fan
> @StatementAllowed or @AllowStatement really doesn't make a ton of sense, but it's short and kind of gets the point across.
> @SideEffects also short, also kind hints at stuff, also could be misleading, and the same for @HasSideEffects.
> My favorite remains @SuppressUnusedResultWarning, which isn't short but pretty damn clear.

+1. This would be my choice as well. It is the warning that is affected, not the result, so “Warning” or “NoWarn” should be in the name.

—CK

>  
> 
>> On Feb 24, 2016, at 7:32 PM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>>> @optional_result (or ideally @optionalResult if camel-case for attributes is accepted) is clearer I think if we want a shortened two-word form.
>> 
> 
> _______________________________________________
> 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/20160224/2a584f12/attachment.html>


More information about the swift-evolution mailing list