File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
stdlib/public/Distributed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -362,16 +362,25 @@ extension DistributedActor {
362
362
/// state.
363
363
///
364
364
/// 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 ? {
368
368
if __isLocalActor ( self ) {
369
369
_local let localSelf = self
370
370
return try await body ( localSelf)
371
371
} else {
372
372
return nil
373
373
}
374
374
}
375
+
376
+ // ABI: Historical whenLocal, rethrows was changed to typed throws `throws(E)`
377
+ @_silgen_name ( " $s11Distributed0A5ActorPAAE9whenLocalyqd__Sgqd__xYiYaYbKXEYaKs8SendableRd__lF " )
378
+ @usableFromInline
379
+ nonisolated func __abi_whenLocal< T: Sendable > (
380
+ _ body: @Sendable ( isolated Self) async throws -> T
381
+ ) async rethrows -> T ? {
382
+ try await whenLocal ( body)
383
+ }
375
384
}
376
385
377
386
/// Supports the operation to produce an any Actor instance from a local
You can’t perform that action at this time.
0 commit comments