File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,20 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
5
5
6
6
## Swift 5.7
7
7
8
+ * [ SE-0347] [ ] :
9
+
10
+ It's now possible to use a default value expression with a generic parameter type
11
+ to default the argument and its type:
12
+
13
+ ```
14
+ func compute<C: Collection>(_ values: C = [0, 1, 2]) {
15
+ ...
16
+ }
17
+ ```
18
+
19
+ ` compute ` is now accepted by compiler and ` [Int] ` is going to be inferred
20
+ for ` C ` at call sites that do not provide the argument explicitly.
21
+
8
22
* [ SE-0326] [ ] :
9
23
10
24
It's now possible to infer parameter and result types from the body of a multi-statement
@@ -9150,6 +9164,7 @@ Swift 1.0
9150
9164
[SE- 0340 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0340-swift-noasync.md>
9151
9165
[SE- 0345 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0345-if-let-shorthand.md>
9152
9166
[SE- 0326 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0326-extending-multi-statement-closure-inference.md>
9167
+ [SE- 0347 ]: < https: // github.com/apple/swift-evolution/blob/main/proposals/0347-type-inference-from-default-exprs.md>
9153
9168
9154
9169
[SR- 75 ]: < https: // bugs.swift.org/browse/SR-75>
9155
9170
[SR- 106 ]: < https: // bugs.swift.org/browse/SR-106>
You can’t perform that action at this time.
0 commit comments