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-2159] Cannot use Swift.Error protocol in ObjC protocols #44767

Closed
colemancda opened this issue Jul 25, 2016 · 3 comments
Closed

[SR-2159] Cannot use Swift.Error protocol in ObjC protocols #44767

colemancda opened this issue Jul 25, 2016 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression swift 3.0

Comments

@colemancda
Copy link
Contributor

Previous ID SR-2159
Radar rdar://problem/27439384
Original Reporter @colemancda
Type Bug
Status Resolved
Resolution Done
Environment

Xcode 8 b3, Swift 2016-07-24

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, 3.0Regression
Assignee None
Priority Medium

md5: 3e4684037e7f9853c70fc620aeb1fce0

relates to:

  • 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

Issue Description:

NSError is supposed to be replaced by Error in Swift 3.0, so this affects how ObjC methods are imported into Swift. Unfortunately there is a compiler assertion preventing the compilation of classes that want to conform to ObjC protocols containing NSError as an argument.

Reproducible example of bug: https://github.com/colemancda/SR-2159

Assertion failed: (PD->isObjC() || *PD->getKnownProtocolKind() == KnownProtocolKind::AnyObject), function forwardDeclare, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/PrintAsObjC/PrintAsObjC.cpp, line 1633.

@belkadan
Copy link
Contributor

cc @DougGregor

@colemancda
Copy link
Contributor Author

Here is a PR for fixing it #3735

@DougGregor
Copy link
Member

a00fa74

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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 regression swift 3.0
Projects
None yet
Development

No branches or pull requests

4 participants