Swift: writing an initializer for a self-referential generic class crashes Xcode
| Originator: | sw | ||
| Number: | rdar://17411857 | Date Originated: | 22-Jun-2014 08:08 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode6-Beta2 (6A216f) |
| Classification: | Crash/Hang/Data Loss | Reproducible: | Always |
Summary:
Typing this simple Linked List node class into a Playground file in Xcode6-Beta2 crashes Xcode.
Steps to Reproduce:
1. Open Xcode6-Beta2
2. Show the Welcome to Xcode window and choose "Get started with a playground"
3. Enter this code into the playground:
class LinkedListNode<T> {
var item: T
var next: LinkedListNode? = nil
init(item: T) {
self.item = item
}
}
Expected Results:
Xcode does not crash
Actual Results:
Xcode crashes when completing the line reading "self.item = item"
Regression:
n/a (also happened in the first Xcode6-Beta release)
Notes:
Running the swift code on the command line yields the following error:
$ swift -i ~/Desktop/LinkedList.playground/section-1.swift
/Users/simon/Desktop/LinkedList.playground/section-1.swift:4:9: error: unimplemented IR generation feature non-fixed class layout
var item: T
^
LLVM ERROR: unimplemented IRGen feature! non-fixed class layout
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!