swift
swift copied to clipboard
[SR-290] Compiler crashes midway through adding conformance to IntegerLiteralType
| Previous ID | SR-290 |
| Radar | rdar://23453104 |
| Original Reporter | @jepers |
| Type | Bug |
| Status | Closed |
| Resolution | Done |
Environment
OS X 10.11.2, Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift 69940d166c)
Additional Detail from JIRA
| Votes | 1 |
| Component/s | Compiler |
| Labels | Bug, CompilerCrash |
| Assignee | None |
| Priority | Medium |
md5: 4786501578c64b0340f19cae531b526c
Issue Description:
See demo below.
Of course Self etc isn't valid code, but this is the code snippet you get by just expanding the IntegerLiteralConvertible's init from the list of code completions you get when writing init.
$ cat > t.swift
struct S : IntegerLiteralConvertible {
init(integerLiteral value: Self.IntegerLiteralType) {
}
}
$ swiftc t.swift
t.swift:2:32: error: 'Self' is only available in a protocol or as the result of a method in a class; did you mean 'S'?
init(integerLiteral value: Self.IntegerLiteralType) {
^~~~
S
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: compile command failed due to signal (use -v to see invocation)
Comment by Paul Eipper (JIRA)
Still an issue in Swift 3 bundled in Xcode 8:
-
Xcode 8 (8A218a)
-
Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
I can reproduce this with Xcode 8.0, but as of Xcode 8.1, the compiler no longer crashes.