mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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.
10 lines
204 B
Swift
10 lines
204 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
@objc class HasStaticProperties {
|
|
@objc class var staticVar1: Int { return 4 }
|
|
}
|
|
|
|
func testStaticProperty(classObj: AnyObject.Type) {
|
|
_ = classObj.staticVar1
|
|
}
|