SE-0317: Async Let

Would async throws let a = boom() be an option? This would then mirror how throwing async functions are declared. It would also be clearer when looking at the code that try would be needed when awaiting a.

Related to this, I’m wondering what would be shown when inspecting the type of a in an IDE (eg option-click in Xcode). This seems related to the possible future direction of how async let variables might be passed to another function (from pitch thread #3)

It would be useful to distinguish async Int (which requires await the first time it’s accessed) from async throws Int (which requires try await).

12 Likes