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
The IsolatedConformances feature moves to a normal, supported feature.
Remove all of the experimental-feature flags on test cases and such.
The InferIsolatedConformances feature moves to an upcoming feature for
Swift 7. This should become an adoptable feature, adding "nonisolated"
where needed.
(cherry picked from commit 3380331)
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