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

Erica Sadun erica at ericasadun.com
Wed Mar 2 13:56:11 CST 2016


Changed per recommendation:

This proposal recommends introducing two further comment fields, specifically `mutatingVariant` and `nonmutatingVariant` to take over the role of the former `mutable_variant:` argument and offer recommendations in both directions.

I should note that the current art is:

    @warn_unused_result(mutable_variant="sortInPlace")
    public func sort() -> [Self.Generator.Element]

-- E


> On Mar 2, 2016, at 12:53 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> 
> On Wed, Mar 2, 2016 at 11:50 AM, Erica Sadun via swift-evolution
> <swift-evolution at swift.org> wrote:
>> This proposal recommends introducing two further comment fields,
>> specifically mutableVariant and immutableVariantto take over the role of the
>> former mutable_variant: argument and offer recommendations in both
>> directions.
> 
> The name 'mutable variant' is not a technically correct one.  There
> are no "mutable method variants" -- methods can't be mutated, there
> are *mutating* method variants.
> 
> Dmitri
> 
> -- 
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/

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


More information about the swift-evolution mailing list