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-5589] A Counter Protocol to AnyObject #48161

Closed
swift-ci opened this issue Jul 31, 2017 · 1 comment
Closed

[SR-5589] A Counter Protocol to AnyObject #48161

swift-ci opened this issue Jul 31, 2017 · 1 comment
Labels
compiler The Swift compiler in itself feature A feature request or implementation swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-5589
Radar None
Original Reporter CTMacUser (JIRA User)
Type New Feature
Status Resolved
Resolution Won't Do
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels New Feature
Assignee None
Priority Medium

md5: 1230c19c4427e1f70b46bcba44b9a4e5

Issue Description:

This is a spin-off of [SR-5588], "Anti-Conformance for Generic Parameters." Someone pointed out on the Swift Evolution list that retroactive conformance would frustrate use of the feature. I then responded that I was making a feature like AnyObject, which is applied exactly for classes, where all classes must conform and it's illegal to make non-classes conform. In the AnyObject case (or the similar case I'm designing), a negated protocol would make sense.

Since there's only a finite number of such qualifying protocols (just 1 right now), we can automatically define a counter protocol that is always applied to non-class types. And it can be used as a base protocol to ban conforming protocols from being applied to classes. A sample name could be NotAnObject.

@belkadan
Copy link
Contributor

AnyObject is no longer a protocol, and since this isn't really a well-defined problem yet a bug report isn't the place to put it. swift-evolution is the right place to discuss something like this.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added feature A feature request or implementation swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal and removed new feature labels Jan 27, 2023
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 feature A feature request or implementation swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal
Projects
None yet
Development

No branches or pull requests

3 participants