Skip to content

Commit a37e318

Browse files
authored
[Distributed] whenLocal adoption of typed throws
whenLocal is a "rethrows" and can be expressed using a typed throw now.
1 parent aa5b505 commit a37e318

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/public/Distributed/DistributedActor.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,9 @@ extension DistributedActor {
362362
/// state.
363363
///
364364
/// When the actor is remote, the closure won't be executed and this function will return nil.
365-
public nonisolated func whenLocal<T: Sendable>(
366-
_ body: @Sendable (isolated Self) async throws -> T
367-
) async rethrows -> T? {
365+
public nonisolated func whenLocal<T: Sendable, E>(
366+
_ body: @Sendable (isolated Self) async throws(E) -> T
367+
) async throws(E) -> T? {
368368
if __isLocalActor(self) {
369369
_local let localSelf = self
370370
return try await body(localSelf)

0 commit comments

Comments
 (0)