I only started with Swift and iOS/OS X development a few days ago, so I don't know the procedure for reporting these things, or where to check if it is a known problem.
If I create a recursive enum that is deep enough – the smaller the enum, the deeper the recursion needed – I get a runtime segfault, but only when the instance is no longer referenced.
It is the very last line that crashes. Creating the large structure works fine. I can also traverse it, no problem. But when I throw it away, I get a crash.
enum Rec {
case Nil
indirect case Wrap(Rec)
init(count: Int) {
self = Nil
for _ in 1...count {
self = Wrap(self)
}
}
}
var rec: Rec
rec = Rec(count: 300_000)
rec = .NilThis is with Xcode 7.1.