mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix build errors
This commit is contained in:
@@ -50,14 +50,14 @@ public final class LocalTestingDistributedActorSystem: DistributedActorSystem, @
|
|||||||
throw LocalTestingDistributedActorSystemError(message: "Unable to locate id '\(id)' locally")
|
throw LocalTestingDistributedActorSystemError(message: "Unable to locate id '\(id)' locally")
|
||||||
}
|
}
|
||||||
guard let actor = anyActor as? Act else {
|
guard let actor = anyActor as? Act else {
|
||||||
throw LocalTestingDistributedActorSystemError(message: "Failed to resolve id '\(id)' as \(Act.Type)")
|
throw LocalTestingDistributedActorSystemError(message: "Failed to resolve id '\(id)' as \(Act.Type.self)")
|
||||||
}
|
}
|
||||||
return actor
|
return actor
|
||||||
}
|
}
|
||||||
|
|
||||||
public func assignID<Act>(_ actorType: Act.Type) -> ActorID
|
public func assignID<Act>(_ actorType: Act.Type) -> ActorID
|
||||||
where Act: DistributedActor {
|
where Act: DistributedActor {
|
||||||
let id = ActorAddress(parse: "\(self.idProvider.next())")
|
let id = self.idProvider.next()
|
||||||
self.assignedIDs.insert(id)
|
self.assignedIDs.insert(id)
|
||||||
return id
|
return id
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ public final class LocalTestingDistributedActorSystem: DistributedActorSystem, @
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func resignID(_ id: ActorID) {
|
public func resignID(_ id: ActorID) {
|
||||||
guard self.assignedIDs.contains(actor.id) else {
|
guard self.assignedIDs.contains(id) else {
|
||||||
fatalError("Attempted to resign unknown id '\(id)'")
|
fatalError("Attempted to resign unknown id '\(id)'")
|
||||||
}
|
}
|
||||||
self.activeActors.removeValue(forKey: id)
|
self.activeActors.removeValue(forKey: id)
|
||||||
|
|||||||
Reference in New Issue
Block a user