[Xcode 12.5 RC] No such module '_Concurrency'

Hey folks, eager to tinker around with the new async/await APIs. Are those working with the new Xcode release?

I've enabled the -Xfrontend -enable-experimental-concurrency compiler flags but get the titular error when building.

I think you need to be on Swift 5.5 (Xcode 12.5 ships with Swift 5.4). I believe 5.4 only has partial support for it.

Ah, gotcha. Know if it's behind the flag in 5.5 or available out of the box?

But await has been deprecated in Xcode 12.5 is this correct and if so what are the replacements?

Deprecations

  • The Swift compiler emits a warning for the use of the await keyword as an unqualified identifier. Wrap await with back-ticks so Swift always treats it as an identifier, or fully qualify declarations named await. For example, add self anytime you reference an instance member named await from within the instance. (SE-0296, 67000350)

That just makes await a keyword in preparation for the concurrency features to come.

2 Likes

is there any way for backward compatibility for this? I have framework built using XCode 13.0 and want to implement it in older xcode version 12.2. Currently getting compile time error - No such module ‘_Concurrency’

1 Like

No, the backward deployment requires Xcode 13.2, and it's only runtime deployment, not compile time. So you'll need to conditionalize your code using #if compiler(>=5.5.2) && canImport(_Concurrency). I would think that would short circuit if the compiler isn't new enough to build the concurrent code.

1 Like