@@ -15,20 +15,27 @@ enum MyError: Error {
15
15
}
16
16
17
17
distributed actor PickATransport1 {
18
- init ( kappa system: FakeActorSystem , other: Int ) { }
18
+ init ( kappa system: FakeActorSystem , other: Int ) {
19
+ self . actorSystem = system
20
+ }
19
21
}
20
22
21
23
distributed actor PickATransport2 {
22
- init ( other: Int , thesystem: FakeActorSystem ) async { }
24
+ init ( other: Int , thesystem: FakeActorSystem ) async {
25
+ self . actorSystem = thesystem
26
+ }
23
27
}
24
28
25
29
distributed actor LocalWorker {
26
- init ( system: FakeActorSystem ) { }
30
+ init ( system: FakeActorSystem ) {
31
+ self . actorSystem = system
32
+ }
27
33
}
28
34
29
35
distributed actor Bug_CallsReadyTwice {
30
36
var x : Int
31
37
init ( system: FakeActorSystem , wantBug: Bool ) async {
38
+ self . actorSystem = system
32
39
if wantBug {
33
40
self . x = 1
34
41
}
@@ -38,6 +45,7 @@ distributed actor Bug_CallsReadyTwice {
38
45
39
46
distributed actor Throwy {
40
47
init ( system: FakeActorSystem , doThrow: Bool ) throws {
48
+ self . actorSystem = system
41
49
if doThrow {
42
50
throw MyError . test
43
51
}
@@ -47,6 +55,7 @@ distributed actor Throwy {
47
55
distributed actor ThrowBeforeFullyInit {
48
56
var x : Int
49
57
init ( system: FakeActorSystem , doThrow: Bool ) throws {
58
+ self . actorSystem = system
50
59
if doThrow {
51
60
throw MyError . test
52
61
}
@@ -108,13 +117,26 @@ struct FakeActorSystem: DistributedActorSystem {
108
117
func remoteCall< Act, Err, Res> (
109
118
on actor : Act ,
110
119
target: RemoteCallTarget ,
111
- invocation: inout InvocationDecoder ,
120
+ invocation: inout InvocationEncoder ,
112
121
throwing: Err . Type ,
113
122
returning: Res . Type
114
123
) async throws -> Res
115
- where Act: DistributedActor ,
116
- Act. ID == ActorID ,
117
- Res: SerializationRequirement {
124
+ where Act: DistributedActor ,
125
+ Act. ID == ActorID ,
126
+ Err: Error ,
127
+ Res: SerializationRequirement {
128
+ throw ExecuteDistributedTargetError ( message: " Not implemented " )
129
+ }
130
+
131
+ func remoteCallVoid< Act, Err> (
132
+ on actor : Act ,
133
+ target: RemoteCallTarget ,
134
+ invocation: inout InvocationEncoder ,
135
+ throwing: Err . Type
136
+ ) async throws
137
+ where Act: DistributedActor ,
138
+ Act. ID == ActorID ,
139
+ Err: Error {
118
140
throw ExecuteDistributedTargetError ( message: " Not implemented " )
119
141
}
120
142
@@ -167,7 +189,7 @@ func test() async {
167
189
// NOTE: All allocated distributed actors should be saved in this array, so
168
190
// that they will be deallocated together at the end of this test!
169
191
// This convention helps ensure that the test is not flaky.
170
- var test : [ DistributedActor ? ] = [ ]
192
+ var test : [ ( any DistributedActor ) ? ] = [ ]
171
193
172
194
test. append ( LocalWorker ( system: system) )
173
195
// CHECK: assign type:LocalWorker, id:ActorAddress(address: "[[ID1:.*]]")
0 commit comments