File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,23 @@ Swift 5.2
193
193
* ` mutating func callAsFunction ` is supported.
194
194
* ` func callAsFunction ` works with ` throws ` and ` rethrows ` .
195
195
* ` 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
+ ```
196
213
197
214
* [ SR-4206] [ ] :
198
215
@@ -7880,6 +7897,7 @@ Swift 1.0
7880
7897
[SE- 0242 ]: < https: // github.com/apple/swift-evolution/blob/master/proposals/0242-default-values-memberwise.md>
7881
7898
[SE- 0244 ]: < https: // github.com/apple/swift-evolution/blob/master/proposals/0244-opaque-result-types.md>
7882
7899
[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>
7883
7901
[SE- 0252 ]: < https: // github.com/apple/swift-evolution/blob/master/proposals/0252-keypath-dynamic-member-lookup.md>
7884
7902
[SE- 0253 ]: < https: // github.com/apple/swift-evolution/blob/master/proposals/0253-callable.md>
7885
7903
[SE- 0254 ]: < https: // github.com/apple/swift-evolution/blob/master/proposals/0254-static-subscripts.md>
You can’t perform that action at this time.
0 commit comments