mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When in Swift 3 compatibility mode without `-warn-swift3-objc-inference`, warn on the *uses* of declarations that depend on the Objective-C runtime that became `@objc` due to the deprecated inference rule. This far more directly captures important uses of the deprecated Objective-C entrypoints. We diagnose: * `#selector` expressions that refer to one of these `@objc` members * `#keyPath` expressions that refer to one of these `@objc` members * Dynamic lookup (i.e., member access via `AnyObject`) that refers to one of these `@objc` members.
12 lines
393 B
Swift
12 lines
393 B
Swift
import ObjectiveC
|
|
|
|
class OtherObjCClass: NSObject {
|
|
@objc private var privateVar = 1 // expected-note 4{{privateVar' declared here}}
|
|
@objc private(set) var privateSetVar = 2 // expected-note 2{{'privateSetVar' declared here}}
|
|
@objc internal var internalVar = 2
|
|
|
|
@objc internal func internalFunc() {}
|
|
|
|
private func privateFunc() {} // expected-note 2{{'privateFunc' declared here}}
|
|
}
|