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
22
33// REQUIRES: executable_test
44// REQUIRES: concurrency
1010
1111import _Distributed
1212
13- @available ( SwiftStdlib 5 . 5 , * )
1413distributed actor SomeSpecificDistributedActor {
1514 deinit {
1615 print ( " deinit \( self . id) " )
@@ -19,25 +18,21 @@ distributed actor SomeSpecificDistributedActor {
1918
2019// ==== Fake Transport ---------------------------------------------------------
2120
22- @available ( SwiftStdlib 5 . 5 , * )
2321struct FakeActorID : ActorIdentity {
2422 let id : UInt64
2523}
2624
27- @available ( SwiftStdlib 5 . 5 , * )
2825enum FakeTransportError : ActorTransportError {
2926 case unsupportedActorIdentity( AnyActorIdentity )
3027}
3128
32- @available ( SwiftStdlib 5 . 5 , * )
3329struct ActorAddress : ActorIdentity {
3430 let address : String
3531 init ( parse address : String ) {
3632 self . address = address
3733 }
3834}
3935
40- @available ( SwiftStdlib 5 . 5 , * )
4136final class FakeTransport : ActorTransport {
4237
4338 deinit {
@@ -72,12 +67,11 @@ final class FakeTransport: ActorTransport {
7267
7368// ==== Execute ----------------------------------------------------------------
7469
75- @available ( SwiftStdlib 5 . 5 , * )
7670func 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 " )
7872 var transport : ActorTransport ? = FakeTransport ( )
7973
80- var remote = try ! SomeSpecificDistributedActor . resolve ( . init( address) , using: transport!)
74+ let remote = try ! SomeSpecificDistributedActor . resolve ( . init( address) , using: transport!)
8175
8276 transport = nil
8377 print ( " done " ) // CHECK: done
@@ -86,12 +80,11 @@ func test_remote() async {
8680 print ( " remote.transport = \( remote. actorTransport) " ) // CHECK: remote.transport = main.FakeTransport
8781
8882 // 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"))
9084 // transport must deinit after the last actor using it does deinit
91- // CHECK: deinit main.FakeTransport
85+ // CHECK-DAG : deinit main.FakeTransport
9286}
9387
94- @available ( SwiftStdlib 5 . 5 , * )
9588@main struct Main {
9689 static func main( ) async {
9790 await test_remote ( )
0 commit comments