Skip to content

Commit 761f407

Browse files
committed
[Concurrency] NonisolatedNonsendingByDefault: Don't attempt to migrate $ prefixed declarations
These are special declarations that are synthesized by the compiler or a macro and warnings about them are non-actionable.
1 parent d30a04e commit 761f407

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

include/swift/AST/Identifier.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ class DeclBaseName {
362362
}
363363

364364
bool hasDollarPrefix() const {
365-
return getIdentifier().hasDollarPrefix();
365+
return !isSpecial() && getIdentifier().hasDollarPrefix();
366366
}
367367

368368
/// A representation of the name to be displayed to users. May be ambiguous

lib/Sema/NonisolatedNonsendingByDefaultMigration.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ void NonisolatedNonsendingByDefaultMigrationTarget::diagnose() const {
100100
return;
101101
}
102102

103+
// A special declaration that was either synthesized by the compiler
104+
// or a macro expansion.
105+
if (decl->getBaseName().hasDollarPrefix()) {
106+
return;
107+
}
108+
103109
// If the attribute cannot appear on this kind of declaration, we can't
104110
// diagnose it.
105111
if (!DeclAttribute::canAttributeAppearOnDecl(DeclAttrKind::Concurrent,

0 commit comments

Comments
 (0)