Swift compiler crash with computed property in global scope
| Originator: | neocool2 | ||
| Number: | rdar://19831917 | Date Originated: | 13-Feb-2015 10:38 PM |
| Status: | Closed | Resolved: | |
| Product: | Developer Tools | Product Version: | Version 6.3 (6D520o) |
| Classification: | Crash/Hang/Data Loss | Reproducible: | Always |
Summary:
Putting any computed property in the global scope will crash the Swift compiler:
public var workdirectory: String {
get { return "" }
}
See also the attached example project which will crash when building.
Steps to Reproduce:
Have a computed property in the global scope
Expected Results:
Code compiles
Actual Results:
Compiler crashes
Regression:
Introduced by Apple Swift version 1.2 (swiftlang-602.0.37.3 clang-602.0.37) - the code compiled fine with the Swift 1.1 compiler
Notes:
Interestingly enough, I was unable to reproduce the problem when running swiftc on the command line, the problem seems to be specific to one of the options passed by Xcode by default.
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!
This was fixed in Xcode 6.3 beta 4