@@ -25,6 +25,17 @@ distributed actor LocalWorker {
25
25
init ( transport: ActorTransport ) { }
26
26
}
27
27
28
+ @available ( SwiftStdlib 5 . 5 , * )
29
+ distributed actor Bug_CallsReadyTwice {
30
+ var x : Int
31
+ init ( transport: ActorTransport , wantBug: Bool ) async {
32
+ if wantBug {
33
+ self . x = 1
34
+ }
35
+ self . x = 2
36
+ }
37
+ }
38
+
28
39
// ==== Fake Transport ---------------------------------------------------------
29
40
30
41
@available ( SwiftStdlib 5 . 5 , * )
@@ -81,6 +92,17 @@ func test() async {
81
92
_ = await PickATransport2 ( other: 1 , theTransport: transport)
82
93
// CHECK: assign type:PickATransport2, id:ActorAddress(address: "[[ID:.*]]")
83
94
// CHECK: ready actor:main.PickATransport2, id:AnyActorIdentity(ActorAddress(address: "[[ID]]"))
95
+
96
+ _ = await Bug_CallsReadyTwice ( transport: transport, wantBug: true )
97
+ // CHECK: assign type:Bug_CallsReadyTwice, id:ActorAddress(address: "[[ID:.*]]")
98
+ // CHECK: ready actor:main.Bug_CallsReadyTwice, id:AnyActorIdentity(ActorAddress(address: "[[ID]]"))
99
+ // CHECK-NEXT: ready actor:main.Bug_CallsReadyTwice, id:AnyActorIdentity(ActorAddress(address: "[[ID]]"))
100
+
101
+ // TODO: it's not obvious why the resigns happen later for the async ones.
102
+ // might need to find a way to force the deallocation at a specific point,
103
+ // or just use check-dag or something.
104
+
105
+ // CHECK: resign id:AnyActorIdentity(ActorAddress(address: "[[ID]]"))
84
106
// CHECK: resign id:AnyActorIdentity(ActorAddress(address: "[[ID]]"))
85
107
}
86
108
0 commit comments