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
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,34 @@
32
32
strategy, given that the code would eventually become ambiguous anyways when
33
33
the deployment target is raised.
34
34
35
+
*[SE-0470][]:
36
+
A protocol conformance can be isolated to a specific global actor, meaning that the conformance can only be used by code running on that actor. Isolated conformances are expressed by specifying the global actor on the conformance itself:
37
+
38
+
```swift
39
+
protocolP {
40
+
funcf()
41
+
}
42
+
43
+
@MainActor
44
+
classMyType: @MainActorP {
45
+
/*@MainActor*/funcf() {
46
+
// must be called on the main actor
47
+
}
48
+
}
49
+
```
50
+
51
+
Swift will produce diagnostics if the conformance is directly accessed in code that isn't guaranteed to execute in the same global actor. For example:
0 commit comments