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-4744] @objc Attribute validation should support Protocol Extension declaration #47321

Closed
swift-ci opened this issue Apr 30, 2017 · 1 comment
Labels
compiler The Swift compiler in itself improvement runtime The Swift Runtime

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-4744
Radar None
Original Reporter garricn (JIRA User)
Type Improvement
Status Resolved
Resolution Won't Do
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, Runtime
Assignee None
Priority Medium

md5: f63bdf0f8e3527e2918ab4f55f8dc55b

duplicates:

  • SR-3349 @objc methods cannot be contained in protocol extensions

Issue Description:

According to https://twitter.com/garricn/status/858489431270936577 the following code should compile:
Apparently, this is a known issue:

import Foundation

@objc protocol SomeProtocol {}

extension SomeProtocol {
    @objc func someFunction() {}
}

However, this code produces the following error at the second use of @objc:

@objc can only be used with members of classes, @objc protocols, and concrete extensions of classes
@belkadan
Copy link
Contributor

belkadan commented May 2, 2017

See SR-3349 for discussion.

@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
compiler The Swift compiler in itself improvement runtime The Swift Runtime
Projects
None yet
Development

No branches or pull requests

2 participants