mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
25 lines
849 B
Swift
25 lines
849 B
Swift
// RUN: %target-swift-frontend -emit-sil -sdk %S/Inputs -I %S/Inputs -enable-source-import %s | %FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import ObjectiveC
|
|
import Foundation
|
|
import gizmo
|
|
|
|
@objc class Foo : NSObject {
|
|
@objc(firstProp) var fooProp: Foo?
|
|
@objc(secondProp) var stringProp: String?
|
|
}
|
|
|
|
// CHECK-LABEL: sil hidden @_T012objc_keypath13createKeyPathSSyF
|
|
func createKeyPath() -> String {
|
|
// CHECK: string_literal utf8 "firstProp.secondProp"
|
|
return #keyPath(Foo.fooProp.stringProp)
|
|
} // CHECK: } // end sil function '_T012objc_keypath13createKeyPathSSyF'
|
|
|
|
// CHECK-LABEL: sil hidden @_T012objc_keypath21createKeyPathImportedSSyF
|
|
func createKeyPathImported() -> String {
|
|
// CHECK: string_literal utf8 "originalName"
|
|
return #keyPath(Gizmo.renamedProp)
|
|
} // CHECK: } // end sil function '_T012objc_keypath21createKeyPathImportedSSyF'
|