File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,22 @@ CHANGELOG
25
25
Swift 5.1
26
26
---------
27
27
28
+ * [ SE-0242] [ ] :
29
+
30
+ The memberwise initializer for structures now provide default values for variables that hold default expressions.
31
+
32
+ ``` swift
33
+ struct Dog {
34
+ var name = " Generic dog name"
35
+ var age = 0
36
+
37
+ // The synthesized memberwise initializer
38
+ init (name : String = " Generic dog name" , age : Int = 0 )
39
+ }
40
+
41
+ let sparky = Dog (name : " Sparky" ) // Dog(name: "Sparky", age: 0)
42
+ ```
43
+
28
44
* [ SE-0068] [ ] :
29
45
30
46
` Self ` can now be used inside member functions and for function arguments of structs and enums to refer to the containing type.
@@ -7511,6 +7527,7 @@ Swift 1.0
7511
7527
[SE- 0228 ]: < https: // github.com/apple/swift-evolution/blob/master/proposals/0228-fix-expressiblebystringinterpolation.md>
7512
7528
[SE- 0230 ]: < https: // github.com/apple/swift-evolution/blob/master/proposals/0230-flatten-optional-try.md>
7513
7529
[SE- 0235 ]: < https: // github.com/apple/swift-evolution/blob/master/proposals/0235-add-result.md>
7530
+ [SE- 0242 ]: < https: // github.com/apple/swift-evolution/blob/master/proposals/0242-default-values-memberwise.md>
7514
7531
[SE- 0245 ]: < https: // github.com/apple/swift-evolution/blob/master/proposals/0245-array-uninitialized-initializer.md>
7515
7532
7516
7533
[SR- 106 ]: < https: // bugs.swift.org/browse/SR-106>
You can’t perform that action at this time.
0 commit comments