Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-3072] Compiler crashes for protocol extensions implementing another @objc protocol #45662

Closed
regexident opened this issue Oct 28, 2016 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software SILGen Area → compiler: The SIL generation stage

Comments

@regexident
Copy link
Contributor

Previous ID SR-3072
Radar None
Original Reporter @regexident
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

macOS Sierra / iOS 10

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, SILGen
Assignee None
Priority Medium

md5: abd99d65a1d5e684f38dbf592b60b444

Issue Description:

Making an extension inherit (and implement) another protocol marked as "@objc" crashes during SIL generation:

import Foundation
@objc protocol Foo { func foo() }
protocol Bar: Foo { }
extension Bar { func foo() { } }

Adding "where Self: NSObject" prevents the crash, seems unreasonably restricting though:

import Foundation
@objc protocol Foo { func foo() }
protocol Bar: Foo { }
extension Bar where Self: NSObject { func foo() { } }

Error:

While emitting IR SIL function @_TToFE4mainPS_3Bar3foofT_T_ for 'foo' at Untitled 3.swift:4:17

(See attachment for complete compiler error output.)

@regexident
Copy link
Contributor Author

Compiles successfully since at least:

Apple Swift version 4.0 (swiftlang-900.0.54.11 clang-900.0.31)
Target: x86_64-apple-macosx10.9

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software SILGen Area → compiler: The SIL generation stage
Projects
None yet
Development

No branches or pull requests

2 participants