1
- // RUN: %target-run-simple-swift(-Xfrontend -enable-experimental-distributed -parse-as-library) | %FileCheck %s --dump-input=always
1
+ // RUN: %target-run-simple-swift(-Xfrontend -enable-experimental-distributed -Xfrontend -disable-availability-checking - parse-as-library) | %FileCheck %s --dump-input=always
2
2
3
3
// REQUIRES: executable_test
4
4
// REQUIRES: concurrency
10
10
11
11
import _Distributed
12
12
13
- @available ( SwiftStdlib 5 . 5 , * )
14
13
distributed actor SomeSpecificDistributedActor {
15
14
deinit {
16
15
print ( " deinit \( self . id) " )
@@ -19,25 +18,21 @@ distributed actor SomeSpecificDistributedActor {
19
18
20
19
// ==== Fake Transport ---------------------------------------------------------
21
20
22
- @available ( SwiftStdlib 5 . 5 , * )
23
21
struct FakeActorID : ActorIdentity {
24
22
let id : UInt64
25
23
}
26
24
27
- @available ( SwiftStdlib 5 . 5 , * )
28
25
enum FakeTransportError : ActorTransportError {
29
26
case unsupportedActorIdentity( AnyActorIdentity )
30
27
}
31
28
32
- @available ( SwiftStdlib 5 . 5 , * )
33
29
struct ActorAddress : ActorIdentity {
34
30
let address : String
35
31
init ( parse address : String ) {
36
32
self . address = address
37
33
}
38
34
}
39
35
40
- @available ( SwiftStdlib 5 . 5 , * )
41
36
final class FakeTransport : ActorTransport {
42
37
43
38
deinit {
@@ -72,12 +67,11 @@ final class FakeTransport: ActorTransport {
72
67
73
68
// ==== Execute ----------------------------------------------------------------
74
69
75
- @available ( SwiftStdlib 5 . 5 , * )
76
70
func test_remote( ) async {
77
- var address = ActorAddress ( parse: " sact://127.0.0.1/example#1234 " )
71
+ let address = ActorAddress ( parse: " sact://127.0.0.1/example#1234 " )
78
72
var transport : ActorTransport ? = FakeTransport ( )
79
73
80
- var remote = try ! SomeSpecificDistributedActor . resolve ( . init( address) , using: transport!)
74
+ let remote = try ! SomeSpecificDistributedActor . resolve ( . init( address) , using: transport!)
81
75
82
76
transport = nil
83
77
print ( " done " ) // CHECK: done
@@ -86,12 +80,11 @@ func test_remote() async {
86
80
print ( " remote.transport = \( remote. actorTransport) " ) // CHECK: remote.transport = main.FakeTransport
87
81
88
82
// only once we exit the function and the remote is released, the transport has no more references
89
- // CHECK: deinit AnyActorIdentity(ActorAddress(address: "sact://127.0.0.1/example#1234"))
83
+ // CHECK-DAG : deinit AnyActorIdentity(ActorAddress(address: "sact://127.0.0.1/example#1234"))
90
84
// transport must deinit after the last actor using it does deinit
91
- // CHECK: deinit main.FakeTransport
85
+ // CHECK-DAG : deinit main.FakeTransport
92
86
}
93
87
94
- @available ( SwiftStdlib 5 . 5 , * )
95
88
@main struct Main {
96
89
static func main( ) async {
97
90
await test_remote ( )
0 commit comments