[SR-5589] A Counter Protocol to AnyObject #48161
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
Additional Detail from JIRA
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 theAnyObject
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
.The text was updated successfully, but these errors were encountered: