Closed
Description
Description
I can't make the following code compile:
struct T {
var p1: String
var p2: Int
var p3: Double
}
extension Array {
func f<each P: Comparable>(_ keyPath: repeat KeyPath<Self.Element, each P>) {
// repeat print(each keyPath) // Type of expression is ambiguous without more context
}
}
let ts: [T] = []
ts.f(\.p1, \.p2, \.p3)
Steps to reproduce
Run the code above using the 2023-05-22 Snapshot
Expected behavior
print \T.p1 \T.p2 \T.p3
Environment
- Swift compiler version info: 2023-05-22 Snapshot
- Xcode version info: Xcode 14.3 Build version 14E222b
- Deployment target: macOS 13.3.1