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-2249] Closure type with value type Error parameter crashes the compiler when used as parameter or property type in class bridged to Objective-C #44856

Closed
swift-ci opened this issue Aug 1, 2016 · 5 comments
Assignees
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 PrintAsClang Area → compiler: The PrintAsClang library

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Aug 1, 2016

Previous ID SR-2249
Radar rdar://problem/27658940
Original Reporter stephan (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, PrintAsObjC
Assignee @DougGregor
Priority Medium

md5: 31a1bc2f69c3d349ed7354683b27a454

relates to:

  • SR-2159 Cannot use Swift.Error protocol in ObjC protocols

Issue Description:

The following crashes the latest snapshot release and the Xcode 8 Beta 4 version of the swift compiler:

import Foundation

enum E: Error { case e }

class Test : NSObject {
  func f(x: (E) -> ()) {}
}

Putting @nonobjc on the function declaration fixes the issue.

@belkadan
Copy link
Contributor

belkadan commented Aug 2, 2016

Stephan pointed out that SR-2159 made it into beta 4, and this is still occurring there.

@DougGregor
Copy link
Member

We shouldn't be making this @objc.

@DougGregor
Copy link
Member

I take it back; SILGen should presumably be able to handle this, but it's odd for it to have to dig up the Error conformance itself.

@DougGregor
Copy link
Member

Continuing the dialogue with myself... this is in the same general category as, e.g., 'Int', where we can bridge with 'NSNumber' explicitly, but the entry point cannot be @objc. Our @objc inference/checking is doing the wrong thing here.

@DougGregor
Copy link
Member

6575877

@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 PrintAsClang Area → compiler: The PrintAsClang library
Projects
None yet
Development

No branches or pull requests

4 participants