Functions that return values return them for a reason.  Ignoring them is, more 
likely than not, an oversight that should be corrected, hence 
@discardableResult.  We're talking error codes, object lifetime tokens, failure 
indicators, etc.  All things that result in ignoring critical code paths for 
the sake of convenience.  If you find yourself executing a lot of side effects 
and ignoring return values, I would take a look at why.  A lot of times you 
have control over the API and can eliminate some of these unused return values. 
 Otherwise, please try to see if the return values of these functions are 
relevant to the well-being of your program.

~Robert Widmann

2016/10/30 8:49、Jody Schofield via swift-dev <[email protected]> のメッセージ:

> Sorry, I'm sure this has been discussed before, but what the heck???
> 
> This feature is killing me. Now I have go add @discardableResult to every 
> function that returns a non-Void or use the ugly syntax `_ =`? 
> 
> Until swift 3 I've really enjoyed the new language. Now I find it to be 
> getting too rigid for the sake of "protecting" me from myself. The safety 
> levels needs to be dialled back some.
> 
> 
> _______________________________________________
> swift-dev mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-dev
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to