Skip to content

Commit b09c55a

Browse files
committed
Temporarily allow @actorIndependent as an alias for nonisolated.
Addresses rdar://78830857.
1 parent 03f55d7 commit b09c55a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

include/swift/AST/DiagnosticsParse.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,8 @@ ERROR(attr_renamed, none,
14281428
"'@%0' has been renamed to '@%1'", (StringRef, StringRef))
14291429
WARNING(attr_renamed_warning, none,
14301430
"'@%0' has been renamed to '@%1'", (StringRef, StringRef))
1431+
WARNING(attr_renamed_to_modifier_warning, none,
1432+
"'@%0' has been renamed to '%1'", (StringRef, StringRef))
14311433
ERROR(attr_name_close_match, none,
14321434
"no attribute named '@%0'; did you mean '@%1'?", (StringRef, StringRef))
14331435
ERROR(attr_unsupported_on_target, none,

lib/Parse/ParseDecl.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2706,7 +2706,7 @@ bool Parser::parseNewDeclAttribute(DeclAttributes &Attributes, SourceLoc AtLoc,
27062706
.highlight(DuplicateAttribute->getRange());
27072707
}
27082708

2709-
// If this is a decl modifier spelled with an @, emit an error and remove it
2709+
// If this is a decl modifier spelled with an @, emit an error and remove it
27102710
// with a fixit.
27112711
if (AtLoc.isValid() && DeclAttribute::isDeclModifier(DK))
27122712
diagnose(AtLoc, diag::cskeyword_not_attribute, AttrName).fixItRemove(AtLoc);
@@ -2989,6 +2989,16 @@ ParserStatus Parser::parseDeclAttribute(
29892989
checkInvalidAttrName(
29902990
"concurrent", "Sendable", DAK_Sendable, diag::attr_renamed_warning);
29912991

2992+
// Historical name for 'nonisolated'.
2993+
if (DK == DAK_Count && Tok.getText() == "actorIndependent") {
2994+
diagnose(
2995+
Tok, diag::attr_renamed_to_modifier_warning, "actorIndependent",
2996+
"nonisolated")
2997+
.fixItReplace(SourceRange(AtLoc, Tok.getLoc()), "nonisolated");
2998+
DK = DAK_Nonisolated;
2999+
AtLoc = SourceLoc();
3000+
}
3001+
29923002
if (DK == DAK_Count && Tok.getText() == "warn_unused_result") {
29933003
// The behavior created by @warn_unused_result is now the default. Emit a
29943004
// Fix-It to remove.

0 commit comments

Comments
 (0)