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

AwaitKit doesn't compile in Xcode 13 / Swift 5.5 #58

Open
siejkowski opened this issue Jun 8, 2021 · 11 comments
Open

AwaitKit doesn't compile in Xcode 13 / Swift 5.5 #58

siejkowski opened this issue Jun 8, 2021 · 11 comments

Comments

@siejkowski
Copy link
Contributor

The introduction of async/await in Swift 5.5 (https://github.com/apple/swift-evolution/blob/main/proposals/0296-async-await.md) promoted the "await" word to keyword. Therefore to use it in the context of function call, it must be wrapped in backticks, just as for the methods called with other language keywords.

I've made a PR that adds the backticks in the right place: #57

Change is compatible with previous Swift versions.

@yannickl
Copy link
Owner

yannickl commented Jun 9, 2021

Oh great! Let me check your PR, thanks.

@dexterliu1214
Copy link

new release?

@burhan1875
Copy link

A new release would be interesting...

@hactar
Copy link

hactar commented Sep 10, 2021

Yeah a new release would be great @yannickl - using master branch directly for now.

@zyflovelam
Copy link

Yeah a new release would be great @yannickl - using master branch directly for now.

I just got an error near the 'async', how do you solve this issue?
image

@rpavlovs
Copy link

Yeah, Xcode 13 broke a bunch of things for us as well:

  1. async { try await(...)} -> 'async(priority:operation:)' is only available in iOS 15.0 or newer
  2. return Promise<AVURLAsset?> { seal in ... -> Cannot pass function of type '(Resolver<AVURLAsset?>) async -> Void' to parameter expecting synchronous function type

@zyflovelam
Copy link

Yeah, Xcode 13 broke a bunch of things for us as well:

  1. async { try await(...)} -> 'async(priority:operation:)' is only available in iOS 15.0 or newer
  2. return Promise<AVURLAsset?> { seal in ... -> Cannot pass function of type '(Resolver<AVURLAsset?>) async -> Void' to parameter expecting synchronous function type

I got an easier way to solve it. I download the source code and copy them to my project. then I renamed all 'async' and 'await' keywords, I added the prefix 'ak', so now I just need to call 'akasync' and 'akawait'.

@rpavlovs
Copy link

Installing Xcode 12 and 13 in parallel (just rename it before copying into applications folder) allows building with Xcode 12 for iOS 15 with no issues.

@fontesrp
Copy link

fontesrp commented Sep 24, 2021

I can confirm that by installing the lib with #57 merged and wrapping every async/await in the project with back-ticks, it is possible to compile on Xcode 13.

-   pod 'AwaitKit', '~> 5'
+   pod 'AwaitKit', :git => 'https://github.com/yannickl/AwaitKit.git', :branch => 'master'

-   return async {
+   return `async` {

-   try await(...)
+   try `await`(...)

@Zaprogramiacz
Copy link

@yannickl Is there a chance for a new version release with @siejkowski support for Swift 5.5 / Xcode 13 soon?

@p-barabas
Copy link

Hi,

could you make a new tag soon with Swift 5.5/Xcode 13 fix? It is needed if I want to use component through swift package manager.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants