Skip to content

Instantly share code, notes, and snippets.

@aschuch
Last active August 29, 2015 14:03
Show Gist options
  • Save aschuch/88e8666ab47fd12741f4 to your computer and use it in GitHub Desktop.
Save aschuch/88e8666ab47fd12741f4 to your computer and use it in GitHub Desktop.
Swift compiler segfault

This Swift class segfaults the compiler since the very first beta. I've submitted a bug report to Apple after it wasn't fixed in beta 2.

Does anyone have a hint what could be going on?

1.	While emitting IR for source file /Users/aschuch/Desktop/Example/Example/Foo.swift
2.	While emitting class metadata for 'Foo' at /Users/aschuch/Desktop/Example/Example/Foo.swift:11:1
<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-Beta3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254
import UIKit
class Foo<T: NSCoding>: NSObject, NSCoding {
let value: T
init(value: T) {
self.value = value
super.init()
}
init(coder aDecoder: NSCoder!) {
value = aDecoder.decodeObjectForKey("value") as T
super.init()
}
func encodeWithCoder(aCoder: NSCoder!) {
aCoder.encodeObject(value, forKey: "value")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment