mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Inherit access control in @abi
ABI-only declarations now inherit access control modifiers like `public` or `private(set)`, as well as `@usableFromInline` and `@_spi`, from their API counterpart. This means these attributes and modifiers don’t need to be specified in an `@abi` attribute. Very few tests because we aren’t yet enforcing the absence of these attributes.
This commit is contained in:
@@ -3165,6 +3165,11 @@ SPIGroupsRequest::evaluate(Evaluator &evaluator, const Decl *decl) const {
|
||||
assert (isa<ValueDecl>(decl) ||
|
||||
isa<ExtensionDecl>(decl));
|
||||
|
||||
// ABI decls share the SPI groups of their API decl.
|
||||
auto abiRole = ABIRoleInfo(decl);
|
||||
if (!abiRole.providesAPI() && abiRole.getCounterpart())
|
||||
return abiRole.getCounterpart()->getSPIGroups();
|
||||
|
||||
// First, look for local attributes.
|
||||
llvm::SetVector<Identifier> spiGroups;
|
||||
for (auto attr : decl->getAttrs().getAttributes<SPIAccessControlAttr>())
|
||||
|
||||
Reference in New Issue
Block a user