You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+64-23Lines changed: 64 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,22 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
5
5
6
6
## Swift 5.7
7
7
8
+
* References to `optional` methods on a protocol metatype, as well as references to dynamically looked up methods on the `AnyObject` metatype are now supported. These references always have the type of a function that accepts a single argument and returns an optional value of function type:
9
+
10
+
```swift
11
+
classObject {
12
+
@objcfuncgetTag() ->Int
13
+
}
14
+
15
+
@objcprotocolP {
16
+
@objcoptionalfuncdidUpdateObject(withTagtag: Int)
17
+
}
18
+
19
+
let getTag: (AnyObject) -> (() ->Int)?=AnyObject.getTag
20
+
21
+
let didUpdateObject: (any P) -> ((Int) ->Void)?= P.didUpdateObject
22
+
```
23
+
8
24
*[SE-0349][]:
9
25
10
26
Loading data from raw memory represented by `UnsafeRawPointer`,
@@ -29,21 +45,47 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
29
45
alignment restriction lifted, so that storing to arbitrary offsets of raw
30
46
memory can now succeed.
31
47
32
-
*References to `optional` methods on a protocol metatype, as well as references to dynamically looked up methods on the `AnyObject` metatype are now supported. These references always have the type of a function that accepts a single argument and returns an optional value of function type:
48
+
*[SE-0334][]:
33
49
34
-
```swift
35
-
classObject {
36
-
@objcfuncgetTag() ->Int
37
-
}
50
+
-`UnsafeRawPointer` and `UnsafeMutableRawPointer` have new functionality for
51
+
pointer arithmetic, adding functions to obtain a pointer advanced to the next
- It is now possible to use a pointer to `struct` to obtain a pointer to one
63
+
of its stored properties:
42
64
43
-
let getTag: (AnyObject) -> (() ->Int)?=AnyObject.getTag
65
+
```swift
66
+
withUnsafeMutablePointer(to: &myStruct) {
67
+
let interiorPointer =$0.pointer(to: \.myProperty)!
68
+
returnmyCFunction(interiorPointer)
69
+
}
70
+
```
71
+
- Comparisons between pointers have been simplified by being more permissive.
72
+
Since pointers are representations of memory locations within a single pool of
73
+
underlying memory, Swift now allows comparing pointers without requiring type
74
+
conversions with the `==`, `!=`, `<`,`<=`,`>`, and `>=` operators.
44
75
45
-
let didUpdateObject: (any P) -> ((Int) ->Void)?= P.didUpdateObject
46
-
```
76
+
* [SE-0333][]:
77
+
78
+
It is now possible to use the `withMemoryRebound<T>()` method on raw memory,
79
+
that is `UnsafeRawPointer` , `UnsafeRawBufferPointer` and their mutable
80
+
counterparts. Additionally, we clarified the semantics of
81
+
`withMemoryRebound<T>()` when used on typed memory (`UnsafePointer<Pointee>`,
82
+
`UnsafeBufferPointer<Pointee>` and their mutable counterparts). Whereas
83
+
`Pointee` and `T` were previously required to have the same stride, you can
84
+
now rebind in cases where `Pointee` is an aggregate of `T` or vice-versa. For
85
+
example, given an `UnsafeMutableBufferPointer<CGPoint>`, you can now use
86
+
`withMemoryRebound` to operate temporarily on a
87
+
`UnsafeMutableBufferPointer<CGFloat>`, because `CGPoint` is an aggregate of
88
+
`CGFloat`.
47
89
48
90
* [SE-0352][]:
49
91
@@ -168,7 +210,7 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
168
210
169
211
Distributed actors provide stronger isolation guarantees than "local" actors, and enable additional checks to be made on return types and parameters of distributed methods, e.g. checking if they conform to `Codable`. Distributed methods can be called on "remote" references of distributed actors, turning those invocations into remote procedure calls, by means of pluggable and user extensible distributed actor system implementations.
170
212
171
-
Swift does not provide any specific distributed actor system by itself, however, packages in the ecosystem fulfil the role of providing those implementations.
213
+
Swift does not provide any specific distributed actor system by itself, however, packages in the ecosystem fulfill the role of providing those implementations.
172
214
173
215
```swift
174
216
distributedactorGreeter {
@@ -297,9 +339,12 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
297
339
return [ 1:"One", 2:"Two" ]
298
340
}
299
341
```
342
+
300
343
Swift 5.6
301
344
---------
302
345
346
+
### 2022-03-14 (Xcode 13.3)
347
+
303
348
*[SE-0327][]:
304
349
305
350
In Swift 5 mode, a warning is now emitted if the default-value expression of an
@@ -528,8 +573,6 @@ Swift 5.6
528
573
}
529
574
```
530
575
531
-
**Add new entries to the top of this section, not here!**
532
-
533
576
Swift 5.5
534
577
---------
535
578
@@ -948,8 +991,6 @@ Swift 5.5
948
991
Asynchronous for loops use asynchronous sequences, defined by the protocol
949
992
`AsyncSequence` and its corresponding `AsyncIterator`.
950
993
951
-
**Add new entries to the top of this section, not here!**
952
-
953
994
Swift 5.4
954
995
---------
955
996
@@ -1116,8 +1157,6 @@ Swift 5.4
1116
1157
let _: Foo?= .bar.anotherFoo.getFoo().optionalFoo?.optionalFoo![]
1117
1158
```
1118
1159
1119
-
**Add new entries to the top of this section, not here!**
0 commit comments