[Swift] Swift compiler crashes on closure with inout parameter
| Originator: | janoschhildebrand | ||
| Number: | rdar://17384066 | Date Originated: | 19-Jun-2014 |
| Status: | Duplicate of 17245353 (Open) | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6 - Beta 2 (6A216f) |
| Classification: | Serious Bug | Reproducible: | Always |
Summary:
The attached project causes the Swift compiler to crash.
The following line causes the crash:
let crash: (inout UInt, UInt) -> Void = { $0 += $1 }
The crash seems to be related to the inout parameter and/or the assignment to the inout parameter. Not using an inout parameter and therefore not assigning to the variable works fine.
The same behaviour happens when using named parameters in the closure as well as when using the closure ass a function call argument instead of a variable.
A crash report is included in the attachment.
Steps to Reproduce:
1. Open the attached project
2. Build
Expected Results:
The compilation should finish successfully or produce an error.
Actual Results:
The compiler crashes.
Version:
Xcode 6 - Beta 2 (6A216f)
Swift version 1.0 (swift-600.0.34.4.8)
OS X 10.10 (14A261i)
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!