Skip to content

Commit 77d0a40

Browse files
committed
[NFC] Add a regression test for SR-12432
1 parent 77d0775 commit 77d0a40

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/Constraints/keypath.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ func testFunc() {
4949
let _: (S) -> Int = f // expected-error {{cannot convert value of type 'KeyPath<S, Int>' to specified type '(S) -> Int'}}
5050
}
5151

52+
struct SR_12432 {
53+
static func takesKeyPath(_: KeyPath<SR_12432.S, String>) -> String { "" }
54+
55+
struct S {
56+
let text: String = takesKeyPath(\.text) // okay
57+
}
58+
}
5259

5360
// SR-11234
5461
public extension Array {

0 commit comments

Comments
 (0)