mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Distributed] ResultHandler.onReturn must be ad-hoc because SerializationRequirement (#41916)
* [Distributed] Invoke handler.onReturn ad hoc via ast synthesized func * reformat and cleanup * remove unused var
This commit is contained in:
committed by
GitHub
parent
e508ce39b0
commit
8d3e7d91c0
@@ -28,6 +28,7 @@ import WinSDK
|
||||
@available(SwiftStdlib 5.7, *)
|
||||
public final class LocalTestingDistributedActorSystem: DistributedActorSystem, @unchecked Sendable {
|
||||
public typealias ActorID = LocalTestingActorAddress
|
||||
public typealias ResultHandler = LocalTestingInvocationResultHandler
|
||||
public typealias InvocationEncoder = LocalTestingInvocationEncoder
|
||||
public typealias InvocationDecoder = LocalTestingInvocationDecoder
|
||||
public typealias SerializationRequirement = Codable
|
||||
@@ -169,7 +170,7 @@ public struct LocalTestingInvocationEncoder: DistributedTargetInvocationEncoder
|
||||
}
|
||||
|
||||
@available(SwiftStdlib 5.7, *)
|
||||
public final class LocalTestingInvocationDecoder : DistributedTargetInvocationDecoder {
|
||||
public class LocalTestingInvocationDecoder : DistributedTargetInvocationDecoder {
|
||||
public typealias SerializationRequirement = Codable
|
||||
|
||||
public func decodeGenericSubstitutions() throws -> [Any.Type] {
|
||||
@@ -189,6 +190,22 @@ public final class LocalTestingInvocationDecoder : DistributedTargetInvocationDe
|
||||
}
|
||||
}
|
||||
|
||||
@available(SwiftStdlib 5.7, *)
|
||||
public struct LocalTestingInvocationResultHandler: DistributedTargetInvocationResultHandler {
|
||||
public typealias SerializationRequirement = Codable
|
||||
public func onReturn<Success: SerializationRequirement>(value: Success) async throws {
|
||||
fatalError("Attempted to call decoder method in a local-only actor system")
|
||||
}
|
||||
|
||||
public func onReturnVoid() async throws {
|
||||
fatalError("Attempted to call decoder method in a local-only actor system")
|
||||
}
|
||||
|
||||
public func onThrow<Err: Error>(error: Err) async throws {
|
||||
fatalError("Attempted to call decoder method in a local-only actor system")
|
||||
}
|
||||
}
|
||||
|
||||
// === errors ----------------------------------------------------------------
|
||||
|
||||
@available(SwiftStdlib 5.7, *)
|
||||
|
||||
Reference in New Issue
Block a user