作者回复: 编译器应该是有警告的,这种是做不到的。
官方给的是:This is intentional: protocol extensions cannot introduce @objc entry points due to limitations of the Objective-C runtime. If you want to add @objc entry points to NSObject, extend NSObject.
可以参见:https://bugs.swift.org/browse/SR-3349?focusedCommentId=21826&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-21826