Merge pull request #79975 from xedin/execution-attr-on-closures

[Concurrency] Extend `@execution(...)` attribute support to closures
This commit is contained in:
Pavel Yaskevich
2025-03-13 09:25:19 -07:00
committed by GitHub
6 changed files with 87 additions and 0 deletions

View File

@@ -1399,6 +1399,12 @@ FunctionType::ExtInfo ClosureEffectsRequest::evaluate(
bool throws = expr->getThrowsLoc().isValid();
bool async = expr->getAsyncLoc().isValid();
bool sendable = expr->getAttrs().hasAttribute<SendableAttr>();
// `@execution(...)` attribute is only valid on asynchronous function types.
if (expr->getAttrs().hasAttribute<ExecutionAttr>()) {
async = true;
}
if (throws || async) {
return ASTExtInfoBuilder()
.withThrows(throws, /*FIXME:*/Type())