[swift-evolution] /*Let it be*/ func() -> @discardable Bool {} /*Rather Than*/ @discardableResult func() -> Bool {}

Chris Lattner clattner at nondot.org
Mon Oct 16 23:10:13 CDT 2017


> On Oct 15, 2017, at 5:55 AM, Mike Kluev via swift-evolution <swift-evolution at swift.org> wrote:
> 
> On 15 October 2017 at 13:35, Geordie Jay <geojay at gmail.com <mailto:geojay at gmail.com>> wrote:
> Also we're not talking about whether the Bool itself is discardable. For example, it makes no sense to write:
> 
> let something: discardable Bool = true
> 
> you can't write this either:
> 
> let something: inout Bool = true
> 
> that doesn't mean "inout" should be "@inputOutput" before the parameter name in function signature.
> 
> my litmus test is: "if we did it now in swift 0.0 what would we do". discardable before type passes this test, @discardableResult before function doesn't.
>  

FWIW, the official litmus test for Swift 5 is explained here:
https://github.com/apple/swift-evolution/ <https://github.com/apple/swift-evolution/>

-Chris



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


More information about the swift-evolution mailing list