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-942] Cannot provide default implementation of @objc protocol via extension #43554

Closed
tjw opened this issue Mar 14, 2016 · 1 comment
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@tjw
Copy link
Contributor

tjw commented Mar 14, 2016

Previous ID SR-942
Radar None
Original Reporter @tjw
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

Xcode 7.3b5 with swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: 7e5f065cdfa911edc13afa2e01139a07

duplicates:

  • SR-492 Protocol extenstion methods aren't exposed to Objective-C

Issue Description:

If you have an @objc protocol, provide a default implementation of methods in it via an extension, and then conform to that protocol in an @objc class, the compiler emits errors about the methods being not-@objc.

It seems like since the extension is on an @objc protocol, the methods defined in the extension should be @objc and the compiler should clone them into the conforming class when the conformance is declared (last line in the sample).

This seems possibly related to https://bugs.swift.org/browse/SR-492 but in my case the protocol and class involved are already marked as @objc.

@belkadan
Copy link
Contributor

It is the same as SR-492, and there's unfortunately not much we can do about it.

@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.
Projects
None yet
Development

No branches or pull requests

2 participants