mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
basic implementation of performing an init of the id after an assign of the actorSystem.
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.
This commit is contained in:
@@ -76,6 +76,10 @@ static VarDecl *addImplicitDistributedActorIDProperty(
|
||||
// mark as nonisolated, allowing access to it from everywhere
|
||||
propDecl->getAttrs().add(
|
||||
new (C) NonisolatedAttr(/*IsImplicit=*/true));
|
||||
// mark as @_compilerInitialized, since we synthesize the initializing
|
||||
// assignment during SILGen.
|
||||
propDecl->getAttrs().add(
|
||||
new (C) CompilerInitializedAttr(/*IsImplicit=*/true));
|
||||
|
||||
nominal->addMember(propDecl);
|
||||
nominal->addMember(pbDecl);
|
||||
|
||||
Reference in New Issue
Block a user