[swift-users] Ambiguous parsing of `return`

Chris Lattner clattner at apple.com
Tue Jun 7 14:35:08 CDT 2016


> On Jun 6, 2016, at 11:50 AM, Jens Alfke via swift-users <swift-users at swift.org> wrote:
> 
> 
>> On Jun 6, 2016, at 11:46 AM, Daniel Dunbar <daniel_dunbar at apple.com <mailto:daniel_dunbar at apple.com>> wrote:
>> 
>> Did you try an example? Swift warns about this for this very reason:
> 
> I don’t get that warning with the latest Xcode 7.3.1 (Swift 2.3 IIRC.) Perhaps you’re using Swift 3? Outside of this community I don’t think many people are using Swift 3 yet.

Yes, this is a new warning produced by Swift 3, specifically introduced to address this issue.


file.swift:3:5: warning: expression following 'return' is treated as an argument of the 'return'
    f0()
    ^
file.swift:3:5: note: indent the expression to silence this warning
    f0()
    ^
-Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160607/99dbc3d5/attachment.html>


More information about the swift-users mailing list