1
1
// RUN: %empty-directory(%t)
2
- // RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %s -module-name Library
3
- // RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -module-name Library
2
+ // RUN: split-file %s %t
3
+
4
+ // RUN: %target-swift-frontend -emit-module -module-name Library \
5
+ // RUN: -swift-version 5 -enable-library-evolution \
6
+ // RUN: -o %t/Library.swiftmodule \
7
+ // RUN: -emit-module-interface-path %t/Library.swiftinterface \
8
+ // RUN: %t/Library.swift
9
+
10
+ /// Verify the interface
4
11
// RUN: %FileCheck %s < %t/Library.swiftinterface
5
12
13
+ /// Verify that we can build from the Library.swiftmodule
14
+ // RUN: %target-swift-frontend -typecheck -module-name Client \
15
+ // RUN: -swift-version 5 \
16
+ // RUN: %t/Client.swift -I%t
17
+
18
+ /// Verify what we can build from a swiftinterface, when swiftmodule was deleted
19
+ // RUN: rm %t/Library.swiftmodule
20
+ // RUN: %target-swift-frontend -typecheck -module-name Client \
21
+ // RUN: -swift-version 5 \
22
+ // RUN: %t/Client.swift -I%t
23
+
6
24
// REQUIRES: distributed
7
25
26
+ //--- Library.swift
27
+
8
28
import Distributed
9
29
10
30
// CHECK-NOT: #if compiler(>=5.3) && $Actors
11
31
// CHECK: @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
12
32
// CHECK-NEXT: distributed public actor DA {
13
33
@available ( SwiftStdlib 5 . 7 , * )
14
34
public distributed actor DA {
15
- // CHECK: @_compilerInitialized nonisolated final public let id: Distributed.LocalTestingActorID
35
+ // CHECK: @_compilerInitialized nonisolated final public let id: Distributed.LocalTestingDistributedActorSystem.ActorID
16
36
// CHECK: nonisolated final public let actorSystem: Library.DA.ActorSystem
17
37
// CHECK: public typealias ActorSystem = Distributed.LocalTestingDistributedActorSystem
18
38
public typealias ActorSystem = LocalTestingDistributedActorSystem
19
39
20
- // CHECK: public static func resolve(id: Distributed.LocalTestingActorID , using system: Library.DA.ActorSystem) throws -> Library.DA
40
+ // CHECK: public static func resolve(id: Distributed.LocalTestingDistributedActorSystem.ActorID , using system: Library.DA.ActorSystem) throws -> Library.DA
21
41
// CHECK: public typealias ID = Distributed.LocalTestingDistributedActorSystem.ActorID
22
42
// CHECK: public typealias SerializationRequirement = any Swift.Decodable & Swift.Encodable
23
43
// CHECK: {{@objc deinit|deinit}}
@@ -31,6 +51,27 @@ public distributed actor DA {
31
51
// CHECK-NEXT: }
32
52
}
33
53
54
+ // CHECK-NOT: #if compiler(>=5.3) && $Actors
55
+ // CHECK: @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
56
+ // CHECK-NEXT: distributed public actor DAG<ActorSystem> where ActorSystem : Distributed.DistributedActorSystem, ActorSystem.SerializationRequirement == any Swift.Decodable & Swift.Encodable {
57
+ @available ( SwiftStdlib 6 . 0 , * )
58
+ public distributed actor DAG < ActorSystem> where ActorSystem: DistributedActorSystem < any Codable > {
59
+ // CHECK: @_compilerInitialized nonisolated final public let id: ActorSystem.ActorID
60
+ // CHECK: nonisolated final public let actorSystem: ActorSystem
61
+
62
+ // CHECK: public static func resolve(id: ActorSystem.ActorID, using system: ActorSystem) throws -> Library.DAG<ActorSystem>
63
+ // CHECK: public typealias ID = ActorSystem.ActorID
64
+ // CHECK: public typealias SerializationRequirement = any Swift.Decodable & Swift.Encodable
65
+ // CHECK: {{@objc deinit|deinit}}
66
+ // CHECK: nonisolated public var hashValue: Swift.Int {
67
+ // CHECK: get
68
+ // CHECK: }
69
+ // CHECK: public init(actorSystem system: ActorSystem)
70
+ // CHECK: @available(iOS 9999, tvOS 9999, watchOS 9999, macOS 9999, *)
71
+ // CHECK: @_semantics("defaultActor") nonisolated final public var unownedExecutor: _Concurrency.UnownedSerialExecutor {
72
+ // CHECK: get
73
+ // CHECK: }
74
+ }
34
75
35
76
// CHECK-NOT: #if compiler(>=5.3) && $Actors
36
77
// CHECK: @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
@@ -41,3 +82,21 @@ public distributed actor DA {
41
82
// CHECK-NOT: #if compiler(>=5.3) && $Actors
42
83
// CHECK: @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
43
84
// CHECK-NEXT:extension Library.DA : Swift.Decodable {}
85
+
86
+ // CHECK-NOT: #if compiler(>=5.3) && $Actors
87
+ // CHECK: @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
88
+ // CHECK-NEXT: extension Library.DAG : Distributed.DistributedActor {}
89
+
90
+ //--- Client.swift
91
+
92
+ import Distributed
93
+ import Library
94
+
95
+ @available ( SwiftStdlib 6 . 0 , * )
96
+ func main( ) {
97
+ let da : DA ? = nil
98
+ _ = da
99
+
100
+ let dag : DAG < LocalTestingDistributedActorSystem > ? = nil
101
+ _ = dag
102
+ }
0 commit comments