Skip to content

Commit a13c134

Browse files
Fruneaujrose-apple
authored andcommitted
Update changelog following import of indirect fields. (#6728)
Signed-off-by: Florent Bruneau <[email protected]>
1 parent 1eb97b6 commit a13c134

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,39 @@ CHANGELOG
2020
Swift 3.1
2121
---------
2222

23+
* Indirect fields from C structures and unions are now always imported, while
24+
they previously weren't imported if they belonged to an union. This is done by
25+
naming anonymous fields. For example:
26+
27+
```c
28+
typedef struct foo_t {
29+
union {
30+
int a;
31+
double b;
32+
};
33+
} foo_t;
34+
```
35+
36+
Get imported as:
37+
38+
```swift
39+
struct foo_t {
40+
struct __Unnamed_union___Anonymous_field0 {
41+
var a : Int { get set }
42+
var b : Double { get set }
43+
}
44+
var __Anonymous_field0 : foo_t.__Unnamed_union___Anonymous_field0
45+
46+
// a and b are computed properties accessing the content of __Anonymous_field0
47+
var a : Int { get set }
48+
var b : Double { get set }
49+
}
50+
```
51+
52+
Since new symbols are exposed from imported structure/unions, this may conflict
53+
with existing code that extended C types in order to provide their own accessors
54+
to the indirect fields.
55+
2356
* The `withoutActuallyEscaping` function from [SE-0103][] has been implemented.
2457
To pass off a non-escaping closure to an API that formally takes an
2558
`@escaping` closure, but which is used in a way that will not in fact

0 commit comments

Comments
 (0)