# Should Swift warn about ineffective cancellation checks inside unstructured tasks?

**URL:** <https://forums.swift.org/t/should-swift-warn-about-ineffective-cancellation-checks-inside-unstructured-tasks/85245>\
**Category:** Discussion\
**Tags:** cancellation, unstructured-task\
**Created:** [March 10, 2026, 10:58am UTC](https://forums.swift.org/t/should-swift-warn-about-ineffective-cancellation-checks-inside-unstructured-tasks/85245 "2026-03-10T10:58:07Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![KeithBauerANZ](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/keithbaueranz/32/27897_2.png) [@KeithBauerANZ](https://forums.swift.org/u/KeithBauerANZ)\
**Post date:** [March 11, 2026, 2:37am UTC](https://forums.swift.org/t/should-swift-warn-about-ineffective-cancellation-checks-inside-unstructured-tasks/85245/9 "2026-03-11T02:37:32Z")

</div>

Even then, it still only works at a single syntactic scope.

Between "even unmanaged tasks can be cancelled" and "outside the immediate lexical scope, all bets are off", I think there are simply too many caveats for this to be useful.

It would be better if instead the `Task` initializer did not allow discarding the task handle, which was/is being discussed here: [Pitch: Remove discardableResult from throwing task initializers](https://forums.swift.org/t/pitch-remove-discardableresult-from-throwing-task-initializers/84721)

---

_[View the full topic](https://forums.swift.org/t/should-swift-warn-about-ineffective-cancellation-checks-inside-unstructured-tasks/85245)._
