Skip to content

Commit 6594417

Browse files
committed
[Distributed] extra test for missing makeEncoder
1 parent a8d78db commit 6594417

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

test/Distributed/distributed_actor_system_missing_adhoc_requirement_impls.swift

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,61 @@ struct MissingRemoteCall: DistributedActorSystem {
4040
}
4141
}
4242

43+
struct MissingRemoteCall_missing_makeInvocationEncoder: DistributedActorSystem {
44+
// expected-error@-1{{type 'MissingRemoteCall_missing_makeInvocationEncoder' does not conform to protocol 'DistributedActorSystem'}}
45+
46+
typealias ActorID = ActorAddress
47+
typealias InvocationDecoder = FakeInvocationDecoder
48+
typealias InvocationEncoder = FakeInvocationEncoder
49+
typealias SerializationRequirement = Codable
50+
51+
func resolve<Act>(id: ActorID, as actorType: Act.Type)
52+
throws -> Act? where Act: DistributedActor {
53+
return nil
54+
}
55+
56+
func assignID<Act>(_ actorType: Act.Type) -> ActorID
57+
where Act: DistributedActor {
58+
ActorAddress(parse: "fake://123")
59+
}
60+
61+
func actorReady<Act>(_ actor: Act)
62+
where Act: DistributedActor,
63+
Act.ID == ActorID {
64+
}
65+
66+
func remoteCall<Act, Err, Res>(
67+
on actor: Act,
68+
target: RemoteCallTarget,
69+
invocation: inout InvocationEncoder,
70+
throwing: Err.Type,
71+
returning: Res.Type
72+
) async throws -> Res
73+
where Act: DistributedActor,
74+
Act.ID == ActorID,
75+
Err: Error,
76+
Res: SerializationRequirement {
77+
fatalError("NOT IMPLEMENTED \(#function)")
78+
}
79+
80+
func remoteCallVoid<Act, Err>(
81+
on actor: Act,
82+
target: RemoteCallTarget,
83+
invocation: inout InvocationEncoder,
84+
throwing: Err.Type
85+
) async throws
86+
where Act: DistributedActor,
87+
Act.ID == ActorID,
88+
Err: Error {
89+
fatalError("NOT IMPLEMENTED \(#function)")
90+
}
91+
92+
func resignID(_ id: ActorID) {
93+
}
94+
95+
// func makeInvocationEncoder() -> InvocationEncoder {} // MISSING
96+
}
97+
4398
struct Error_wrongReturn: DistributedActorSystem {
4499
// expected-error@-1{{struct 'Error_wrongReturn' is missing witness for protocol requirement 'remoteCall'}}
45100
// expected-note@-2{{protocol 'Error_wrongReturn' requires function 'remoteCall' with signature:}}

0 commit comments

Comments
 (0)