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

Erica Sadun erica at ericasadun.com
Wed Mar 2 16:18:17 CST 2016

If anyone has a chance to look through the revised draft, I would greatly appreciate it: https://gist.github.com/erica/c8ddb9c7a1154a98a703

Thank you, -- Erica

> On Mar 2, 2016, at 2:46 PM, Dmitri Gribenko via swift-evolution <swift-evolution at swift.org> wrote:
> On Wed, Mar 2, 2016 at 1:38 PM, David Owens II <david at owensd.io> wrote:
>> Had the API been marked as discardable, there's no way to tell if you've
>> made an oversight error or were being explicit about not needing the result.
> The point you are making is true of any source-level annotations that
> can't be verified by the compiler independently.  For example,
> force-unwrapping an optional -- there is no way to tell, either for a
> compiler or even another engineer, whether force-unwrapping is a logic
> error or not.
> 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>*/
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

More information about the swift-evolution mailing list