-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language features
Description
Previous ID | SR-15678 |
Radar | None |
Original Reporter | restermans (JIRA User) |
Type | Bug |
Environment
swiftc --version
swift-driver version: 1.26.9 Apple Swift version 5.5.1 (swiftlang-1300.0.31.4 clang-1300.0.29.6)
Target: x86_64-apple-macosx12.0
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Bug, Concurrency |
Assignee | None |
Priority | Medium |
md5: c8c7aed5b405714204b16916abd0cfa9
Issue Description:
Attempting to compile the following program taken from `async let` proposal page (SE-0317) fails with error: "Capturing 'async let' variables is not supported".
Task {
async let name = "Alice"
await greet { await name } // Capturing 'async let' variables is not supported
}
@discardableResult
func greet(_ f: () async -> String) async -> String { await f() }
While in the proposal it's stated that "It is legal to capture a async let in a non-escaping asynchronous closure" - https://github.com/apple/swift-evolution/blob/main/proposals/0317-async-let.md#async-let-and-closures
tomwyrmalhal, yaroslav2308, danallenio and aryamenonk
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language features