I'm having an issue when using a Generic as the type constraint on a property. Here is a very simple example:
import UIKit
class TSSignal<MessageType> {
var message: MessageType?
init() {
}
}
In Xcode 6 Beta (6A215l) this will not compile. It fails with the following error at the bottom:
TSSignal.swift:13:9: error: unimplemented IR generation feature non-fixed class layout var message: MessageType? ^ LLVM ERROR: unimplemented IRGen feature! non-fixed class layout Command /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code
But, if I remove the line var message: MessageType?
it will build fine. Any ideas? Thanks.
Edit - changed code and error to reflect current status of issue
Edit - related: Swift compile error when subclassing NSObject and using generics
Update (6/18/14) - The issue still persists as of Xcode 6 - Beta 2
Update (7/25/14) - The issue still persists as of Xcode 6 - Beta 4 (thanks @Ralfonso, and I verified as well)
Update (8/4/14) - The issue is FIXED as of Xcode 6 - Beta 5!