mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #79975 from xedin/execution-attr-on-closures
[Concurrency] Extend `@execution(...)` attribute support to closures
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user