-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itself
Description
Previous ID | SR-9919 |
Radar | None |
Original Reporter | @AliSoftware |
Type | Bug |
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug |
Assignee | None |
Priority | Medium |
md5: 924803a6681795b962e04f6332511076
Issue Description:
Summary
A pure Swift class non-inheriting NSObject can be marked as @objcMembers
Expected results
The compiler should error when classes not inheriting NSObjects are declared as @objcMembers
, the same way it errors about those with @objc
Actual results
No error (and the class is omitted from the generated interface)
Example
When annotating with @objc
we get the following expected error:
import Foundation
@objc class Foo {} // error: Only classes that inherit from NSObject can be declared @objc
But when annotating with @objcMembers
we don't and this compiles without any error:
import Foundation
@objcMembers class Foo {}
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itself