Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-15678] "Capturing 'async let' variables is not supported" compilation error #57957

Open
swift-ci opened this issue Jan 3, 2022 · 0 comments
Open

Comments

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Jan 3, 2022

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

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant