Autocomplete does not use shortest Swift closure syntax
| Originator: | alex | ||
| Number: | rdar://18110778 | Date Originated: | 23-Aug-2014 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6 beta-6 |
| Classification: | Bug | Reproducible: | Always |
Summary:
When using a function that takes a closure as one argument, autocomplete always uses the most verbose declaration of the closure although shorter versions are more readable and valid
Steps to Reproduce:
1. Create a Swift function like the following:
func executeClosure(closure: ()->Void) {
closure()
}
2. Use this function by typing executeClo and autocompleting it to executeClosure(<#closure: () -> ()##() -> ()#>)
3. Autocomplete the closure bubble
Expected Results:
This should result in code like this:
executeClosure {
<#code#>
}
Actual Results:
Xcode expands to a fully specified version of the closure that is less legible
executeClosure { () -> Void in
<#code#>
}
Version:
Xcode 6.0 (6A280e)
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!