Skip to content

Commit 0665e21

Browse files
authored
CHANGELOG: Add SE-0189, which went in a while ago. (#13981)
1 parent 1381d08 commit 0665e21

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
@@ -22,6 +22,23 @@ CHANGELOG
2222
Swift 4.1
2323
---------
2424

25+
* [SE-0189][]
26+
27+
If an initializer is declared in a different module from a struct, it must
28+
use `self.init(…)` or `self = …` before returning or accessing `self`.
29+
Failure to do so will produce a warning in Swift 4 and an error in Swift 5.
30+
This is to keep a client app from accidentally depending on a library's
31+
implementation details, and matches an existing restriction for classes,
32+
where cross-module initializers must be convenience initializers.
33+
34+
This will most commonly affect code that extends a struct imported from C.
35+
However, most imported C structs are given a zeroing no-argument initializer,
36+
which can be called as `self.init()` before modifying specific properties.
37+
38+
Swift library authors who wish to continue allowing initialization on a
39+
per-member basis should explicitly declare a public memberwise initializer
40+
for clients in other modules to use.
41+
2542
* [SE-0166][] / [SE-0143][]
2643

2744
The standard library now defines the conformances of `Optional`,

0 commit comments

Comments
 (0)