@@ -256,7 +256,6 @@ class AttributeChecker : public AttributeVisitor<AttributeChecker> {
256
256
257
257
void visitActorAttr (ActorAttr *attr);
258
258
void visitDistributedActorAttr (DistributedActorAttr *attr);
259
- void visitDistributedActorIndependentAttr (DistributedActorIndependentAttr *attr);
260
259
void visitGlobalActorAttr (GlobalActorAttr *attr);
261
260
void visitAsyncAttr (AsyncAttr *attr);
262
261
void visitMarkerAttr (MarkerAttr *attr);
@@ -5400,7 +5399,7 @@ void AttributeChecker::visitActorAttr(ActorAttr *attr) {
5400
5399
void AttributeChecker::visitDistributedActorAttr (DistributedActorAttr *attr) {
5401
5400
auto dc = D->getDeclContext ();
5402
5401
5403
- // distributed can be applied to actor class definitions and async functions
5402
+ // distributed can be applied to actor definitions and their methods
5404
5403
if (auto varDecl = dyn_cast<VarDecl>(D)) {
5405
5404
// distributed can not be applied to stored properties
5406
5405
diagnoseAndRemoveAttr (attr, diag::distributed_actor_property);
@@ -5473,7 +5472,13 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
5473
5472
// distributed actors. Attempts of nonisolated access would be
5474
5473
// cross-actor, and that means they might be accessing on a remote actor,
5475
5474
// 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 ))) {
5477
5482
diagnoseAndRemoveAttr (attr,
5478
5483
diag::nonisolated_distributed_actor_storage);
5479
5484
return ;
@@ -5504,16 +5509,6 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
5504
5509
}
5505
5510
}
5506
5511
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
-
5517
5512
void AttributeChecker::visitGlobalActorAttr (GlobalActorAttr *attr) {
5518
5513
auto nominal = dyn_cast<NominalTypeDecl>(D);
5519
5514
if (!nominal)
0 commit comments