[swift-evolution] Property Getter Return Statement

Adrian Zubarev adrian.zubarev at devandartist.com
Mon Oct 9 02:59:30 CDT 2017

Even I would personally want this, this request didn’t made into Swift 3, nor in Swift 4 and is clearly out of scope for Swift 5.

You can read my proposal here which includes all areas where this could be allowed: https://github.com/DevAndArtist/swift-evolution/blob/single_expression_optional_return/proposals/nnnn-single-expression-optional-return.md

Here are two posts from Chris Lattner why this feature won’t come any time soon:

- https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170213/032376.htmlhttps://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170213/032446.html

Am 9. Oktober 2017 um 06:56:19, Charles Srstka via swift-evolution (swift-evolution at swift.org) schrieb:

On Oct 7, 2017, at 12:22 PM, Tony Allevato via swift-evolution <swift-evolution at swift.org> wrote:

I think the important thing to consider is, what advantage would such a feature provide *other* than to reduce keystrokes? (I don't personally think that optimizing for keys pressed by itself should be a goal.)

Consistency? I know I’ve accidentally left out the ‘return’ enough times due to muscle memory from writing closures kicking in, and then had to go back and fix it. Having two different sets of rules for two very similar constructs makes the development process slower.


swift-evolution mailing list
swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171009/542ab4f6/attachment.html>

More information about the swift-evolution mailing list