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

Rod Brown rodney.brown6 at icloud.com
Wed Feb 24 18:33:21 CST 2016


I’m on board with @AllowUnusedResult or @IgnoreUnusedResult.

I think allow looks nicer and works as an attribute, but I suspect though that this may have an implied suggestion that without it, this is disallowed (rather than just a warning).

> On 25 Feb 2016, at 11:22 AM, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I'd recommend against snake case. (It's a thing). Some thoughts:
> 
> @SuppressResultUseWarning
> @SuppressResultUsageWarning
> @SuppressUnusedResultWarning
> 
> @OptionalResultUse (or Usage)
> @PermitOptionalResultUse (or Usage)
> @AllowOptionalResultUse (or Usage)
> 
> @IgnoreUnusedResult
> @PermitUnusedResult
> @AllowUnusedResult
> 
> @NoWarnUnusedResult
> @NoResultWarning
> @NoResultUseWarning
> @NoResultUsageWarning
> @NoWarningUnusedResult
> @NoWarningForUnusedResult
> @NoWarningOnUnusedResult
> 
> @AllowProceduralCall
> @EnableProceduralCall
> @PermitProceduralCall
> 
> -- E
> 
>> On Feb 24, 2016, at 5:08 PM, Haravikk via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>>> 
>>> On 24 Feb 2016, at 23:44, Janosch Hildebrand <jnosh at jnosh.com <mailto: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
>>> 
>>> 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 <https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160215/010510.html>
>>> 
>>> - Janosch

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160225/f251cb82/attachment.html>


More information about the swift-evolution mailing list