Skip to content

Commit a475135

Browse files
authored
Avoid errors in old toolchains, add to-be-removed convenience keyword (#1026)
It was reported that beta-2 toolchain errors out on the missing `convenience` in this init. This is actually fixed by https://github.com/apple/swift-evolution/blob/main/proposals/0327-actor-initializers.md which @kavon implemented, so as soon as we get a stable Swift which does not need the convenience keyword we can drop it. Adding for now to make life of early adopters easier.
1 parent 5100fd1 commit a475135

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/DistributedActors/Pattern/WorkerPool.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ public distributed actor WorkerPool<Worker: DistributedWorker>: DistributedWorke
8383
/// Control for waiting and getting notified for new worker.
8484
private var newWorkerContinuations: [CheckedContinuation<Void, Never>] = []
8585

86-
public init(selector: Selector, actorSystem: ActorSystem) async throws {
86+
// TODO(distributed): the convenience is no longer required, but because this only got fixed in very recent toolchains; we keep it on for now. We should be able to remove this once 5.7 lands with this fixed (it is the actors and initializers proposal)
87+
public convenience init(selector: Selector, actorSystem: ActorSystem) async throws {
8788
try await self.init(settings: .init(selector: selector), actorSystem: actorSystem)
8889
}
8990

0 commit comments

Comments
 (0)