Swift compiler segfaults trying to compile the following class:
| Originator: | jgallagher | ||
| Number: | rdar://17157251 | Date Originated: | 6/4/2014 |
| Status: | Open | Resolved: | |
| Product: | Xcode | Product Version: | 6.0 |
| Classification: | Crash | Reproducible: | Always |
Add a file to a Swift project with these contents:
class Foo : Sequence {
class FooGenerator : Generator {
typealias Element = Int
var current = 0
func next() -> Element? {
if current < 10 {
return current
} else {
return nil
}
}
}
typealias Generator = FooGenerator
func generate() -> FooGenerator {
return FooGenerator()
}
}
This pops up an error saying "SourceKitService Terminated" (and Xcode loses syntax highlighting, indentation, etc.), and trying to build the project results in a segfault:
1. While type-checking 'Foo' at /Users/john/Documents/swift/SwiftSegfault2/Boom.swift:9: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-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254
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!