Location
https://docs.swift.org/swift-book/documentation/the-swift-programming-language/summaryofthegrammar#Expressions
Description
The grammar of closure-expression does not allow attributes before in:
For example:
Task.detached { @MainActor in
// ...
}
As far as I can tell this syntax has been added by https://github.com/swiftlang/swift-evolution/blob/main/proposals/0316-global-actors.md#closures
The current grammar is closure-expression → { attributes? closure-signature? statements? }, which only would allow { @Something ... } but not { @Something in ... }.
This was added by acb77ae
Correction
No response
Location
https://docs.swift.org/swift-book/documentation/the-swift-programming-language/summaryofthegrammar#Expressions
Description
The grammar of
closure-expressiondoes not allow attributes beforein:For example:
As far as I can tell this syntax has been added by https://github.com/swiftlang/swift-evolution/blob/main/proposals/0316-global-actors.md#closures
The current grammar is
closure-expression → { attributes? closure-signature? statements? }, which only would allow{ @Something ... }but not{ @Something in ... }.This was added by acb77ae
Correction
No response