Zum Inhalt springen

Missing Cancellation Check (ARCH9024)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key swift.async.missing-cancellation-check · Severity warning · Category async

Flags long loops in async functions that never check Task.isCancelled / Task.checkCancellation() - cancellation cannot stop them.

for item in items { await process(item) }
for item in items { try Task.checkCancellation(); await process(item) }

Check Task.isCancelled or call Task.checkCancellation() inside the loop.