Skip to content

Commit 3145188

Browse files
authored
Correct a fact around @objc protocol adoption (#67)
For example, the following works even though the C class isn't marked @objc, isn't a subclass of NSObject, and isn't a subclass of an @objc class: import Foundation @objc protocol P {} class C: P {} Fixes #66
2 parents b24b294 + f0505d7 commit 3145188

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Sources/TSPL/TSPL.docc/LanguageGuide/Protocols.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,9 +2145,8 @@ Optional requirements are available so that you can write code
21452145
that interoperates with Objective-C.
21462146
Both the protocol and the optional requirement
21472147
must be marked with the `@objc` attribute.
2148-
Note that `@objc` protocols can be adopted only by classes
2149-
that inherit from Objective-C classes or other `@objc` classes.
2150-
They can't be adopted by structures or enumerations.
2148+
Note that `@objc` protocols can be adopted only by classes,
2149+
not by structures or enumerations.
21512150

21522151
When you use a method or property in an optional requirement,
21532152
its type automatically becomes an optional.

0 commit comments

Comments
 (0)