mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
14 lines
686 B
Swift
14 lines
686 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -module-name protocol_overrides -emit-module -enable-library-evolution -emit-module-path=%t/protocol_overrides.swiftmodule %S/../SILGen/Inputs/protocol_overrides.swift
|
|
// RUN: %target-swift-frontend -module-name keypath_witness_overrides -emit-ir %s -I %t | %FileCheck %s
|
|
|
|
import protocol_overrides
|
|
|
|
// CHECK: @keypath = private global
|
|
// CHECK-SAME: %swift.method_descriptor** @"{{got.|__imp_}}$s18protocol_overrides14OriginalGetterPy7ElementQz5IndexQzcigTq"
|
|
public func getWritableKeyPath<OS: OverridesSetter>(_ c: OS, index: OS.Index) -> AnyKeyPath
|
|
where OS.Index: Hashable {
|
|
let keypath = \OS.[index]
|
|
return keypath
|
|
}
|