Files
swift-mirror/test/expr/dynamic_lookup.swift
Doug Gregor 7dd1c87dd3 [SE-0160] Warn about uses of @objc declarations that used deprecated @objc inference.
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.
2017-03-31 21:22:15 -07:00

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
}