google / promises

Promises is a modern framework that provides a synchronization construct for Swift and Objective-C.
Apache License 2.0
3.79k stars 292 forks source link

Future versions of Swift reserve the word 'await'; if this name is unavoidable, use backticks to escape it #167

Closed wilg closed 3 years ago

wilg commented 3 years ago

This warning appears on Xcode 12.5 beta 2.

shoumikhin commented 3 years ago

Great! Many thanks for the heads up, Wil :) Do you mind to do the change and send us a PR? Thanks.

wilg commented 3 years ago

More an issue of the API design, since this library exposes a function called await.

shoumikhin commented 3 years ago

Wil, I agree. If we take it in backticks, does it solve the issue?

wilg commented 3 years ago

The warning appears at the call site unfortunately (in user code, not the framework), so I think the only solution is to rename it or require all users of the API to use backticks to call await.

Presumably at some point this promises library will integrate with the official Swift async/await, so probably won't be an issue then, but will be an issue until then.

shoumikhin commented 3 years ago

Gotcha, thanks for the details, Wil! If we go the rename route, what name would you suggest for that API?

wilg commented 3 years ago

Maybe awaitPromise?

shoumikhin commented 3 years ago

I like it! Wil, can you make the change?