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 {
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)
371371 } else {
372372 return nil
373373 }
374374 }
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+ }
375384}
376385
377386/// Supports the operation to produce an any Actor instance from a local
You can’t perform that action at this time.
0 commit comments