Skip to content

[SR-75] Referencing a protocol function crashes the compiler #42697

@swift-ci

Description

@swift-ci
Previous ID SR-75
Radar rdar://21289579
Original Reporter Sephiroth87 (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Xcode 7.1.1

Additional Detail from JIRA
Votes 4
Component/s Compiler
Labels Bug, CompilerCrash
Assignee @slavapestov
Priority Medium

md5: 85007b8954c0d9c1507fbd1a12838bdf

is duplicated by:

  • SR-2544 Compiler crash on access to protocol function
  • SR-3036 Crash When Calling Curried Instance Method on Protocol
  • SR-3670 Calling default implementation as a curried method causes compiler crash
  • SR-4375 Using Generic with Protocols causes Segmentation Fault
  • SR-5638 Compiler Crash - Protocol Function Reference
  • SR-6234 Compiler crashes with protocol P { func f() }; type(of: P.f)
  • SR-7264 Compile-time segmentation fault while referencing protocol method
  • SR-7633 Compiler crash (Segmentation Fault 11) when assigning protocol method to variable
  • SR-7968 Compiler crash when accessing protocol extension method by type name
  • SR-8654 Trying to get Protocol.method crashes the compiler
  • SR-8904 Compiler crash when using protocol function as member of protocol.
  • SR-9053 Compiler crashes with Segmentation fault
  • SR-9147 Compiler crash in lowering
  • SR-9779 Crash while emitting SIL for curried call to protocol instance method
  • SR-10345 Compiler crash on invalid closure syntax
  • SR-10618 Trying to get a reference to a protocol's member crashes the compiler
  • SR-10815 Protocol method partial application seg fault
  • SR-11769 Crash when attempting to assign an unbound method from a protocol
  • SR-12589 Segmentation Fault when compiling instance method call from protocol
  • SR-12604 Crash creating unbound reference to protocol method
  • SR-12657 Swift 5.2 compiler crash, protocol method reference
  • SR-5240 Creating a reference to a protocol-based function crashes the compiler

relates to:

  • SR-1329 LLVM error when assigning protocol function to variable

Issue Description:

The following code will crash the compiler

protocol MyProtocol {
    func myFunc() -> String
}

let f = MyProtocol.myFunc

Metadata

Metadata

Assignees

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