@objc attribute & Windows

I added some thoughts on a related JIRA. [SR-14548] 5.4 Linux Toolchain no longer ignores @objc · Issue #56900 · apple/swift · GitHub

Having the attribute be ignored on Linux [and Windows here] for classes and protocols would require a Swift evolution proposal [earlier, they were ignored due to a bug, not intentionally]. You could submit a small evolution pitch for that. If that gets some momentum, you could submit a proposal with an implementation.

Another option is a Swift evolution pitch for more flexible usage around attributes. In [Accepted] SE-0308: postfix `#if` config expressions, it says

The core team believes that additional refinement of conditional compilation is something that the language would benefit from. As such, proposals extending support towards conditional compilation of repeated lexical constructs, e.g. elements within an array literal, would be welcome.


They were ignored earlier on other platforms (such as Linux) due to a compiler bug. Right now (for Swift 5.5) they are supported for enums but disallowed for classes and protocols.