mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The resignID call within the initializer moved into DI, because an assignment to the actorSystem, and thus initialization of the id, is no longer guaranteed to happen. Thus, while we previously could model the resignation as a clean-up emitted on all unwind paths in an initializer, now it's conditional, based on whether the id was initialized. This is exactly what DI is designed to do, so we inject the resignation call just before we call the identity's deinit.
20 lines
698 B
Swift
20 lines
698 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend-emit-module -emit-module-path %t/FakeDistributedActorSystems.swiftmodule -module-name FakeDistributedActorSystems -disable-availability-checking %S/Inputs/FakeDistributedActorSystems.swift
|
|
// RUN: %target-swift-frontend -typecheck -verify -enable-experimental-distributed -disable-availability-checking -I %t 2>&1 %s
|
|
// REQUIRES: concurrency
|
|
// REQUIRES: distributed
|
|
|
|
import Distributed
|
|
import FakeDistributedActorSystems
|
|
|
|
typealias DefaultDistributedActorSystem = FakeActorSystem
|
|
|
|
distributed actor DA {
|
|
}
|
|
|
|
func take<A: Codable>(actor: A) {}
|
|
|
|
func test(actorSystem: FakeActorSystem) {
|
|
take(actor: DA(actorSystem: actorSystem)) // ok
|
|
}
|