# Auditing potentially async code

**URL:** <https://forums.swift.org/t/auditing-potentially-async-code/49344>\
**Category:** Using Swift\
**Tags:** concurrency, asyncawait\
**Created:** [June 7, 2021, 10:49pm UTC](https://forums.swift.org/t/auditing-potentially-async-code/49344 "2021-06-07T22:49:05Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jayton](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jayton/32/5592_2.png) [@jayton](https://forums.swift.org/u/jayton)\
**Post date:** [June 8, 2021, 7:51am UTC](https://forums.swift.org/t/auditing-potentially-async-code/49344/3 "2021-06-08T07:51:19Z")

</div>

There’s [a pitch](https://forums.swift.org/t/pitch-completionhandlerasync-attribute/49004/2) for an attribute that will generate a warning when you use a callback-based API in an async context.

Warning in all contexts would be unhelpful, since you can’t use the async variants in a non-async context, but warning in such cases on an opt-in basis (_gasp!_ Dialects!) or building an external tool on top of [SwiftSyntax](https://github.com/apple/swift-syntax) might be feasible.

---

_[View the full topic](https://forums.swift.org/t/auditing-potentially-async-code/49344)._
