I have created an enum named Task
in my project. Now I want to use the Swift Task
(
Instead of explicitly writing out _Concurrency.Task
in order to disambiguate everywhere, consider the following:
- You can create a
typealias
for the type (e.g.typealias SwiftTask = _Concurrency.Task
) if you prefer your ownTask
type taking precedence, and don't want to rename it - Alternatively, depending on whether it makes sense for your project (and is reasonable in context): this might be an opportunity to consider a more specific name for your type to possibly avoid both nominal and logical conflicts.
async
/await
andTask
are major new language/stdlib features that are going to be influential for a long time, so it may make sense to pick a less general word if the stdlib is going to be reserving that one going forward