Naming clash with Swift's Task
mschinis opened this issue Β· comments
Describe the bug π
Hi, I'm in the process of adopting async/await in our project. Wherever I have an import AlgoliaSearchClient
, I cannot use Swift's Task
type because it clashes with the library's Task
protocol:
Compile time error
'Task' cannot be constructed because it has no accessible initializers
Current workaround
To work-around this for now, I can use _Concurrency.Task
but would generally like to avoid having to to do so, as it uses the semiprivate _Concurrency
module.
To Reproduce π
Steps to reproduce the behavior:
- import AlgoliaSearchClient in a project file
- Use this code somewhere in that file:
Task {
try await Task.sleep(1_000_000_000) // 1 second
}
Expected behavior π
Be able to import AlgoliaSearchClient and use the swift Task
type without using _Concurrency
Hi @mschinis ,
Thank you for reporting this issue. It's actually embarrassing.
I will look into it π
no worries - your protocol has probably been around before Swift's Task
anyway π¬
Fixed in the release 8.14 β
Thank you @VladislavFitz π