mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
26 lines
514 B
Swift
26 lines
514 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module %s -DLIBRARY -o %t/Lib.swiftmodule
|
|
// RUN: %target-swift-frontend -typecheck %s -I %t -verify
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
// https://github.com/apple/swift/issues/46299
|
|
|
|
#if LIBRARY
|
|
|
|
import Foundation
|
|
public class Test: NSObject {
|
|
@objc public var prop: NSObject?
|
|
}
|
|
|
|
#else
|
|
|
|
import Lib
|
|
|
|
func test() {
|
|
_ = #keyPath(Test.prop) // okay
|
|
_ = #keyPath(Test.nonexistent) // expected-error {{type 'Test' has no member 'nonexistent'}}
|
|
}
|
|
|
|
#endif
|