Self-executing closure with variable declaration crashes the Swift compiler
| Originator: | josh.hinman | ||
| Number: | rdar://17317691 | Date Originated: | 6/14/2014 |
| Status: | Open | Resolved: | |
| Product: | Xcode | Product Version: | 6.0 |
| Classification: | Crash | Reproducible: | Always |
Summary:
Self-executing closure with variable declaration crashes the Swift compiler:
func foo() {
({ var bar = "bar" })()
}
Steps to Reproduce:
1. Open a playground in Xcode 6 beta 1
2. Paste the following code:
func foo() {
({ var bar = "bar" })()
}
Expected Results:
Closure should execute and set the bar variable to "bar"
Actual Results:
Xcode crashes
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!