Swift fails to compile enum with recursive type reference
| Originator: | jlieske | ||
| Number: | rdar://17225563 | Date Originated: | 08-Jun-2014 04:23 PM |
| Status: | Duplicate | Resolved: | |
| Product: | OS X SDK | Product Version: | Xcode6 beta: Version 6.0 (6A215l) |
| Classification: | Crash | Reproducible: | Always |
The Swift language supports enums with type parameters for associated values. Such enum types should support recursive relationships, such as the classic linked list.
For example, this seems to be a reasonable enum declaration:
enum List<T> {
case Nil
case Cons(T, List<T>)
}
However, it fails to compile in Swift source code files. The compiler reports the error:
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
Command /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254
Furthermore, pasting that class definition in a Playground file causes Xcode to crash. When Xcode tries to re-launch with the Playground file with the definition, it crashes repeatedly.
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!
Apple closed as duplicate of rdar://17100336