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
_**Note:** This is in reverse chronological order, so newer entries are added to the top._
28
5
29
6
Swift 5.5
30
7
---------
31
8
9
+
*[SE-0306][]:
10
+
11
+
Swift 5.5 includes support for actors, a new kind of type that isolates its instance data to protect it from concurrent access. Accesses to an actor's instance declarations from outside the must be asynchronous:
12
+
13
+
```swift
14
+
actorCounter {
15
+
var value =0
16
+
17
+
funcincrement() {
18
+
value = value +1
19
+
}
20
+
}
21
+
22
+
funcuseCounter(counter: Counter) async {
23
+
print(await counter.value) // interaction must be async
24
+
await counter.increment() // interaction must be async
25
+
}
26
+
```
27
+
32
28
* The determination of whether a call to a `rethrows` function can throw now considers default arguments of `Optional` type.
33
29
34
30
In Swift 5.4, such default arguments were ignored entirely by `rethrows` checking. This meant that the following example was accepted:
@@ -173,11 +169,11 @@ Swift 5.5
173
169
174
170
The "for" loop can be used to traverse asynchronous sequences in asynchronous code:
175
171
176
-
```swift
172
+
```swift
177
173
fortryawait line in myFile.lines() {
178
174
// Do something with each line
179
175
}
180
-
```
176
+
```
181
177
182
178
Asynchronous for loops use asynchronous sequences, defined by the protocol
183
179
`AsyncSequence` and its corresponding `AsyncIterator`.
@@ -187,6 +183,8 @@ Swift 5.5
187
183
Swift 5.4
188
184
---------
189
185
186
+
### 2021-04-26 (Xcode 12.5)
187
+
190
188
* Protocol conformance checking now considers `where` clauses when evaluating if a `typealias` is a suitable witness for an associated type requirement. The following code is now rejected:
0 commit comments