1
1
// RUN: %empty-directory(%t)
2
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-swift-frontend-emit-module -I %t -emit-module-path %t/distributed_actor_protocol_isolation.swiftmodule -module-name distributed_actor_protocol_isolation -disable-availability-checking %s
4
- // X: %target-swift-frontend -typecheck -verify -disable-availability-checking -I %t 2>&1 %s
3
+ // RUN: %target-swift-frontend -typecheck -verify -disable-availability-checking -I %t 2>&1 %s
5
4
// REQUIRES: concurrency
6
5
// REQUIRES: distributed
7
6
@@ -15,7 +14,7 @@ protocol Greeting: DistributedActor {
15
14
}
16
15
17
16
extension Greeting {
18
- func greetLocal( name: String ) {
17
+ func greetLocal( name: String ) { // expected-note{{distributed actor-isolated instance method 'greetLocal(name:)' declared here}}
19
18
print ( " \( greeting ( ) ) , \( name) ! " ) // okay, we're on the actor
20
19
}
21
20
}
@@ -28,10 +27,12 @@ extension Greeting where SerializationRequirement == Codable {
28
27
}
29
28
}
30
29
31
- extension Greeting {
30
+ extension Greeting where Self . SerializationRequirement == Codable {
32
31
nonisolated func greetAliceALot( ) async throws {
33
- // try await greetDistributed(name: "Alice") // okay, via Codable
34
- // let rawGreeting = try await greeting() // okay, via Self's serialization requirement
35
- // greetLocal(name: "Alice") // expected-error{{only 'distributed' instance methods can be called on a potentially remote distributed actor}}
32
+ try await self . greetDistributed ( name: " Alice " ) // okay, via Codable
33
+ let rawGreeting = try await greeting ( ) // okay, via Self's serialization requirement
34
+ _ = rawGreeting
35
+
36
+ greetLocal ( name: " Alice " ) // expected-error{{only 'distributed' instance methods can be called on a potentially remote distributed actor}}
36
37
}
37
38
}
0 commit comments