Skip to content

Unnecessary Task Await (ARCH9025)

Key swift.async.unnecessary-task-await · Severity info · Category async

Flags Task { ... }.value awaited immediately - a task created only to be waited for.

let user = await Task { await repo.load(id) }.value
let user = await repo.load(id)

Call the async function directly; Task is for work that runs concurrently with something else.