Skip to content

Commit 8d280cf

Browse files
authored
Add a comment about inheritance of actor isolation (#148)
1 parent 69dd001 commit 8d280cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Sources/Atoms/AsyncPhase.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ public enum AsyncPhase<Success, Failure: Error> {
2929
/// returned value as a success, or thrown error as a failure.
3030
///
3131
/// - Parameter body: A async throwing closure to evaluate.
32-
public init(catching body: @Sendable () async throws(Failure) -> Success) async {
32+
public init(
33+
// Adopt SE-0420 Inheritance of actor isolation instead of adding @Sendable
34+
// to the body closure once the compiler crash that happens with Swift 6.0
35+
// when used in an initializer is solved.
36+
// isolation: isolated (any Actor)? = #isolation,
37+
catching body: @Sendable () async throws(Failure) -> Success
38+
) async {
3339
do {
3440
let value = try await body()
3541
self = .success(value)

0 commit comments

Comments
 (0)