Skip to content

Commit 9b93a08

Browse files
authored
[NFC] Add SE-0249 to changelog (#29686)
1 parent 362047f commit 9b93a08

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,23 @@ Swift 5.2
193193
* `mutating func callAsFunction` is supported.
194194
* `func callAsFunction` works with `throws` and `rethrows`.
195195
* `func callAsFunction` works with trailing closures.
196+
197+
* [SE-0249][]:
198+
199+
A `\Root.value` key path expression is now allowed wherever a `(Root) -> Value`
200+
function is allowed. Such an expression is implicitly converted to a key path
201+
application of `{ $0[keyPath: \Root.value] }`.
202+
203+
For example:
204+
205+
```swift
206+
struct User {
207+
let email: String
208+
let isAdmin: Bool
209+
}
210+
211+
users.map(\.email) // this is equivalent to: users.map { $0[keyPath: \User.email] }
212+
```
196213

197214
* [SR-4206][]:
198215

@@ -7880,6 +7897,7 @@ Swift 1.0
78807897
[SE-0242]: <https://github.com/apple/swift-evolution/blob/master/proposals/0242-default-values-memberwise.md>
78817898
[SE-0244]: <https://github.com/apple/swift-evolution/blob/master/proposals/0244-opaque-result-types.md>
78827899
[SE-0245]: <https://github.com/apple/swift-evolution/blob/master/proposals/0245-array-uninitialized-initializer.md>
7900+
[SE-0249]: <https://github.com/apple/swift-evolution/blob/master/proposals/0249-key-path-literal-function-expressions.md>
78837901
[SE-0252]: <https://github.com/apple/swift-evolution/blob/master/proposals/0252-keypath-dynamic-member-lookup.md>
78847902
[SE-0253]: <https://github.com/apple/swift-evolution/blob/master/proposals/0253-callable.md>
78857903
[SE-0254]: <https://github.com/apple/swift-evolution/blob/master/proposals/0254-static-subscripts.md>

0 commit comments

Comments
 (0)