@@ -4411,6 +4411,7 @@ static void checkGlobalActorAttr(
44114411 std::pair<CustomAttr *, NominalTypeDecl *> &globalActorAttr) {
44124412 auto isolatedAttr = decl->getAttrs ().getAttribute <IsolatedAttr>();
44134413 auto nonisolatedAttr = decl->getAttrs ().getAttribute <NonisolatedAttr>();
4414+ auto executionAttr = decl->getAttrs ().getAttribute <ExecutionAttr>();
44144415 struct NameAndRange {
44154416 StringRef name;
44164417 SourceRange range;
@@ -4419,7 +4420,7 @@ static void checkGlobalActorAttr(
44194420 : name(_name), range(_range) {}
44204421 };
44214422
4422- llvm::SmallVector<NameAndRange, 3 > attributes;
4423+ llvm::SmallVector<NameAndRange, 4 > attributes;
44234424
44244425 attributes.push_back (NameAndRange (globalActorAttr.second ->getName ().str (),
44254426 globalActorAttr.first ->getRangeWithAt ()));
@@ -4432,6 +4433,11 @@ static void checkGlobalActorAttr(
44324433 attributes.push_back (NameAndRange (nonisolatedAttr->getAttrName (),
44334434 nonisolatedAttr->getRangeWithAt ()));
44344435 }
4436+ if (executionAttr) {
4437+ attributes.push_back (NameAndRange (executionAttr->getAttrName (),
4438+ executionAttr->getRangeWithAt ()));
4439+ }
4440+
44354441 if (attributes.size () == 1 )
44364442 return ;
44374443
@@ -4442,9 +4448,10 @@ static void checkGlobalActorAttr(
44424448 .highlight (attributes[1 ].range )
44434449 .warnUntilSwiftVersion (6 )
44444450 .fixItRemove (attributes[1 ].range );
4451+ return ;
4452+ }
44454453
4446- } else {
4447- assert (attributes.size () == 3 );
4454+ if (attributes.size () == 3 ) {
44484455 decl->diagnose (diag::actor_isolation_multiple_attr_3, decl,
44494456 attributes[0 ].name , attributes[1 ].name , attributes[2 ].name )
44504457 .highlight (attributes[0 ].range )
@@ -4453,7 +4460,21 @@ static void checkGlobalActorAttr(
44534460 .warnUntilSwiftVersion (6 )
44544461 .fixItRemove (attributes[1 ].range )
44554462 .fixItRemove (attributes[2 ].range );
4463+ return ;
44564464 }
4465+
4466+ assert (attributes.size () == 4 );
4467+ decl->diagnose (diag::actor_isolation_multiple_attr_4, decl,
4468+ attributes[0 ].name , attributes[1 ].name , attributes[2 ].name ,
4469+ attributes[3 ].name )
4470+ .highlight (attributes[0 ].range )
4471+ .highlight (attributes[1 ].range )
4472+ .highlight (attributes[2 ].range )
4473+ .highlight (attributes[3 ].range )
4474+ .warnUntilSwiftVersion (6 )
4475+ .fixItRemove (attributes[1 ].range )
4476+ .fixItRemove (attributes[2 ].range )
4477+ .fixItRemove (attributes[3 ].range );
44574478}
44584479
44594480void AttributeChecker::visitCustomAttr (CustomAttr *attr) {
0 commit comments