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@swift.org) schrieb:

On Oct 7, 2017, at 12:22 PM, Tony Allevato via swift-evolution 
<swift-evolution@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.

Charles

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to