Swift's trailing closure syntax doesn't support Allman Style brackets.

Originator:bergamot
Number:rdar://17343981 Date Originated:6/17/2014
Status: Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:
 
Summary:
Allman style brackets work throughout Swift, except with the trailing closure syntax.

Steps to Reproduce:
Typed:

SCNTransaction.setCompletionBlock
{
    SCNTransaction.begin()
    SCNTransaction.setAnimationDuration(0.5)
                
    material.emission.contents = UIColor.blackColor()
                
    SCNTransaction.commit()
}

Also tried with () after setCompletionBlock

Expected Results:
I expected it to compile without issue.

Actual Results:
Two Swift compiler errors:

"Braced block of statements is an unused closure"
"Expression resolves to an unused function"

Version:
Xcode Version 6.0 (6A215l)

OS X 10.9.3 (13D65)

Notes:
Was able to get it working by wrapping the brackets with parentheses, but that totally defeats the purpose of the trailing closure syntax.

Configuration:


Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!