The SE-0249 Proposal gives the following code as an example, but it doesn't compile.
[1, nil, 3, nil, 5].compactMap(\.self)
// error: cannot convert value of type 'WritableKeyPath<Int, Int>' to expected argument type '(Int?) throws -> ElementOfResult?'