mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sema: Inherit SPI groups when synthesizing modify accessor.
Resolves rdar://108069565
This commit is contained in:
@@ -1494,3 +1494,15 @@ bool swift::addNonIsolatedToSynthesized(NominalTypeDecl *nominal,
|
||||
value->getAttrs().add(new (ctx) NonisolatedAttr(/*isImplicit=*/true));
|
||||
return true;
|
||||
}
|
||||
|
||||
void swift::applyInferredSPIAccessControlAttr(Decl *decl,
|
||||
const Decl *inferredFromDecl,
|
||||
ASTContext &ctx) {
|
||||
auto spiGroups = inferredFromDecl->getSPIGroups();
|
||||
if (spiGroups.empty())
|
||||
return;
|
||||
|
||||
auto spiAttr =
|
||||
SPIAccessControlAttr::create(ctx, SourceLoc(), SourceRange(), spiGroups);
|
||||
decl->getAttrs().add(spiAttr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user