Skip to content

Commit 17976c7

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 f2f5d23 commit 17976c7

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
@@ -105,6 +105,12 @@ void NonisolatedNonsendingByDefaultMigrationTarget::diagnose() const {
105105
return;
106106
}
107107

108+
// A special declaration that was either synthesized by the compiler
109+
// or a macro expansion.
110+
if (decl->getBaseName().hasDollarPrefix()) {
111+
return;
112+
}
113+
108114
// If the attribute cannot appear on this kind of declaration, we can't
109115
// diagnose it.
110116
if (!DeclAttribute::canAttributeAppearOnDecl(DeclAttrKind::Concurrent,

0 commit comments

Comments
 (0)