mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #80159 from AnthonyLatsis/danaus-plexippus-5
Sema: Extend adoption mode for `AsyncCallerExecution` to storage declarations
This commit is contained in:
@@ -478,19 +478,13 @@ static bool usesFeatureBuiltinEmplaceTypedThrows(Decl *decl) {
|
||||
}
|
||||
|
||||
static bool usesFeatureExecutionAttribute(Decl *decl) {
|
||||
if (auto *ASD = dyn_cast<AbstractStorageDecl>(decl)) {
|
||||
if (auto *getter = ASD->getAccessor(AccessorKind::Get))
|
||||
return usesFeatureExecutionAttribute(getter);
|
||||
if (!DeclAttribute::canAttributeAppearOnDecl(DeclAttrKind::Execution, decl)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (decl->getAttrs().hasAttribute<ExecutionAttr>())
|
||||
return true;
|
||||
|
||||
auto VD = dyn_cast<ValueDecl>(decl);
|
||||
if (!VD)
|
||||
return false;
|
||||
|
||||
auto hasExecutionAttr = [](TypeRepr *R) {
|
||||
if (!R)
|
||||
return false;
|
||||
@@ -508,8 +502,10 @@ static bool usesFeatureExecutionAttribute(Decl *decl) {
|
||||
});
|
||||
};
|
||||
|
||||
auto *VD = cast<ValueDecl>(decl);
|
||||
|
||||
// Check if any parameters that have `@execution` attribute.
|
||||
if (auto *PL = getParameterList(VD)) {
|
||||
if (auto *PL = VD->getParameterList()) {
|
||||
for (auto *P : *PL) {
|
||||
if (hasExecutionAttr(P->getTypeRepr()))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user