Skip to content

[SR-290] Compiler crashes midway through adding conformance to IntegerLiteralType #42912

@jepers

Description

@jepers
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 69940d1)

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of software

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions