Skip to content

Commit 844d4df

Browse files
authored
Merge pull request #23760 from Azoy/se-0242-changelog
[Changelog] Add SE-0242
2 parents 1cbad4c + 861129b commit 844d4df

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ CHANGELOG
2525
Swift 5.1
2626
---------
2727

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+
2844
* [SE-0068][]:
2945

3046
`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
75117527
[SE-0228]: <https://github.com/apple/swift-evolution/blob/master/proposals/0228-fix-expressiblebystringinterpolation.md>
75127528
[SE-0230]: <https://github.com/apple/swift-evolution/blob/master/proposals/0230-flatten-optional-try.md>
75137529
[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>
75147531
[SE-0245]: <https://github.com/apple/swift-evolution/blob/master/proposals/0245-array-uninitialized-initializer.md>
75157532

75167533
[SR-106]: <https://bugs.swift.org/browse/SR-106>

0 commit comments

Comments
 (0)