# Why #warning() not allowed in some source location?

**URL:** <https://forums.swift.org/t/why-warning-not-allowed-in-some-source-location/39643>\
**Category:** Using Swift\
**Created:** [August 23, 2020, 9:38pm UTC](https://forums.swift.org/t/why-warning-not-allowed-in-some-source-location/39643 "2020-08-23T21:38:38Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Douglas\_Gregor](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/douglas_gregor/32/1362_2.png) [@Douglas\_Gregor](https://forums.swift.org/u/Douglas_Gregor)\
**Post date:** [September 2, 2020, 8:21pm UTC](https://forums.swift.org/t/why-warning-not-allowed-in-some-source-location/39643/7 "2020-09-02T20:21:44Z")

</div>

> [@young](#):
>
> 👌[https://bugs.swift.org/browse/SR-13436](https://bugs.swift.org/browse/SR-13436)

FYI, I'll be returning this as "behaves correctly". Swift (intentionally) doesn't have the C-preprocessor-like behavior of letting # directives go anywhere: `#warning` is a declaration, so it cannot be in the middle of a postfix-expression chain.

Doug

---

_[View the full topic](https://forums.swift.org/t/why-warning-not-allowed-in-some-source-location/39643)._
