11// 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
411// RUN: %FileCheck %s < %t/Library.swiftinterface
512
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+
624// REQUIRES: distributed
725
26+ //--- Library.swift
27+
828import Distributed
929
1030// CHECK-NOT: #if compiler(>=5.3) && $Actors
1131// CHECK: @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
1232// CHECK-NEXT: distributed public actor DA {
1333@available ( SwiftStdlib 5 . 7 , * )
1434public distributed actor DA {
15- // CHECK: @_compilerInitialized nonisolated final public let id: Distributed.LocalTestingActorID
35+ // CHECK: @_compilerInitialized nonisolated final public let id: Distributed.LocalTestingDistributedActorSystem.ActorID
1636 // CHECK: nonisolated final public let actorSystem: Library.DA.ActorSystem
1737 // CHECK: public typealias ActorSystem = Distributed.LocalTestingDistributedActorSystem
1838 public typealias ActorSystem = LocalTestingDistributedActorSystem
1939
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
2141 // CHECK: public typealias ID = Distributed.LocalTestingDistributedActorSystem.ActorID
2242 // CHECK: public typealias SerializationRequirement = any Swift.Decodable & Swift.Encodable
2343 // CHECK: {{@objc deinit|deinit}}
@@ -31,6 +51,27 @@ public distributed actor DA {
3151 // CHECK-NEXT: }
3252}
3353
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
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+ }
3475
3576// CHECK-NOT: #if compiler(>=5.3) && $Actors
3677// CHECK: @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
@@ -41,3 +82,21 @@ public distributed actor DA {
4182// CHECK-NOT: #if compiler(>=5.3) && $Actors
4283// CHECK: @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
4384// 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