@@ -256,7 +256,6 @@ class AttributeChecker : public AttributeVisitor<AttributeChecker> {
256256
257257 void visitActorAttr (ActorAttr *attr);
258258 void visitDistributedActorAttr (DistributedActorAttr *attr);
259- void visitDistributedActorIndependentAttr (DistributedActorIndependentAttr *attr);
260259 void visitGlobalActorAttr (GlobalActorAttr *attr);
261260 void visitAsyncAttr (AsyncAttr *attr);
262261 void visitMarkerAttr (MarkerAttr *attr);
@@ -5400,7 +5399,7 @@ void AttributeChecker::visitActorAttr(ActorAttr *attr) {
54005399void AttributeChecker::visitDistributedActorAttr (DistributedActorAttr *attr) {
54015400 auto dc = D->getDeclContext ();
54025401
5403- // distributed can be applied to actor class definitions and async functions
5402+ // distributed can be applied to actor definitions and their methods
54045403 if (auto varDecl = dyn_cast<VarDecl>(D)) {
54055404 // distributed can not be applied to stored properties
54065405 diagnoseAndRemoveAttr (attr, diag::distributed_actor_property);
@@ -5473,7 +5472,13 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
54735472 // distributed actors. Attempts of nonisolated access would be
54745473 // cross-actor, and that means they might be accessing on a remote actor,
54755474 // in which case the stored property storage does not exist.
5476- if (nominal && nominal->isDistributedActor ()) {
5475+ //
5476+ // The synthesized "id" and "actorTransport" are the only exceptions,
5477+ // because the implementation mirrors them.
5478+ if (nominal && nominal->isDistributedActor () &&
5479+ !(var->isImplicit () &&
5480+ (var->getName () == Ctx.Id_id ||
5481+ var->getName () == Ctx.Id_actorTransport ))) {
54775482 diagnoseAndRemoveAttr (attr,
54785483 diag::nonisolated_distributed_actor_storage);
54795484 return ;
@@ -5504,16 +5509,6 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
55045509 }
55055510}
55065511
5507- void AttributeChecker::visitDistributedActorIndependentAttr (DistributedActorIndependentAttr *attr) {
5508- // / user-inaccessible _distributedActorIndependent can only be applied to let properties
5509- if (auto var = dyn_cast<VarDecl>(D)) {
5510- if (!var->isLet ()) {
5511- diagnoseAndRemoveAttr (attr, diag::distributed_actor_independent_property_must_be_let);
5512- return ;
5513- }
5514- }
5515- }
5516-
55175512void AttributeChecker::visitGlobalActorAttr (GlobalActorAttr *attr) {
55185513 auto nominal = dyn_cast<NominalTypeDecl>(D);
55195514 if (!nominal)
0 commit comments