1
1
// RUN: %empty-directory(%t)
2
- // RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -disable-availability-checking %S/../Inputs/FakeDistributedActorSystems.swift
3
- // RUN: %target-build-swift -module-name main -Xfrontend -disable-availability-checking -j2 -parse-as-library -I %t %s %S/../Inputs/FakeDistributedActorSystems.swift -o %t/a.out
2
+ // RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -disable-availability-checking %S/../Inputs/FakeDistributedActorSystems.swift -plugin-path %swift-plugin-dir
3
+ // RUN: %target-build-swift -module-name main -Xfrontend -disable-availability-checking -j2 -parse-as-library -I %t %s %S/../Inputs/FakeDistributedActorSystems.swift -plugin-path %swift-plugin-dir - o %t/a.out
4
4
// RUN: %target-codesign %t/a.out
5
5
// RUN: %target-run %t/a.out | %FileCheck %s --color --dump-input=always
6
6
7
- // UNSUPPORTED: OS=windows-msvc
8
-
9
7
// REQUIRES: executable_test
10
8
// REQUIRES: concurrency
11
9
// REQUIRES: distributed
14
12
// UNSUPPORTED: use_os_stdlib
15
13
// UNSUPPORTED: back_deployment_runtime
16
14
15
+ // FIXME(distributed): Distributed actors currently have some issues on windows, isRemote always returns false. rdar://82593574
16
+ // UNSUPPORTED: OS=windows-msvc
17
+
17
18
// FIXME(distributed): pending rework of distributed protocol target mangling
18
19
// XFAIL: *
19
20
@@ -22,34 +23,11 @@ import FakeDistributedActorSystems
22
23
23
24
// ==== Known actor system -----------------------------------------------------
24
25
25
- // @DistributedRemotelyJustViaProxyAccessible
26
+ @ _DistributedProtocol
26
27
protocol GreeterDefinedSystemProtocol : DistributedActor where ActorSystem == FakeRoundtripActorSystem {
27
28
distributed func greet( ) -> String
28
29
}
29
30
30
- // start of @Proxy output =======
31
- extension GreeterDefinedSystemProtocol where Self == GreeterDefinedSystemProtocol_Stub {
32
- static func resolve(
33
- id: ID , using system: ActorSystem
34
- ) throws -> any GreeterDefinedSystemProtocol {
35
- print ( " \( Self . self) . \( #function) -> return \( GreeterDefinedSystemProtocol_Stub . self) " )
36
-
37
- return try GreeterDefinedSystemProtocol_Stub . resolve ( id: id, using: system)
38
- }
39
- }
40
-
41
- distributed actor GreeterDefinedSystemProtocol_Stub : GreeterDefinedSystemProtocol {
42
- typealias ActorSystem = FakeRoundtripActorSystem
43
- init ( actorSystem: ActorSystem ) {
44
- self . actorSystem = actorSystem
45
- }
46
-
47
- distributed func greet( ) -> String {
48
- fatalError ( " Stub implementation " )
49
- }
50
- }
51
- // end of @Proxy output =======
52
-
53
31
/// A concrete implementation done on the "server" side of a non-symmetric application
54
32
distributed actor GreeterImpl : GreeterDefinedSystemProtocol {
55
33
typealias ActorSystem = FakeRoundtripActorSystem
@@ -70,7 +48,8 @@ distributed actor GreeterImpl: GreeterDefinedSystemProtocol {
70
48
print ( " local call greeting: \( realGreeting) " )
71
49
// CHECK: local call greeting: [IMPL]:Hello from GreeterImpl
72
50
73
- let proxy : any GreeterDefinedSystemProtocol = try . resolve( id: real. id, using: roundtripSystem)
51
+ let proxy : any GreeterDefinedSystemProtocol =
52
+ try $GreeterDefinedSystemProtocol. resolve ( id: real. id, using: roundtripSystem)
74
53
let greeting = try await proxy. greet ( )
75
54
// CHECK: >> remoteCall: on:main.GreeterDefinedSystemProtocol_Stub, target:greet(), invocation:FakeInvocationEncoder(genericSubs: [], arguments: [], returnType: Optional(Swift.String), errorType: nil), throwing:Swift.Never, returning:Swift.String
76
55
// CHECK: > execute distributed target: greet(), identifier: $s4main28GreeterDefinedSystemProtocolP5greetSSyFTE
0 commit comments