[swift-evolution] [Pitch] Make `return` optional in computed properties for a single case

Vladimir.S svabox at gmail.com
Tue May 31 15:05:06 CDT 2016


+1 from me to this updated proposal. Now I like it very much :)

On 31.05.2016 22:36, Adrian Zubarev via swift-evolution wrote:
>> Exactly.  You are allowed to omit `return` if the entire body only
>> consists of `return some().expression`
>
> Thats where the useless example comes in (but we don’t need this behavior
> at all):
>
> func foo(boolean: Bool) {
>
>     guard boolean else {}
>
>     print("true“)
>
> }
>
> I made some changes to the
> proposal: https://github.com/DevAndArtist/swift-evolution/blob/single_expression_optional_return/proposals/nnnn-single-expression-optional-return.md
>
> Please review it again. :)
> --
> Adrian Zubarev
> Sent with Airmail
>
>
>
> _______________________________________________
> 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