# \[Accepted\] SE-0367: Conditional compilation for attributes

**URL:** <https://forums.swift.org/t/accepted-se-0367-conditional-compilation-for-attributes/59756>\
**Category:** Announcements\
**Created:** [August 19, 2022, 12:27am UTC](https://forums.swift.org/t/accepted-se-0367-conditional-compilation-for-attributes/59756 "2022-08-19T00:27:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Groff](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/joe_groff/32/1929_2.png) [@Joe\_Groff](https://forums.swift.org/u/Joe_Groff)\
**Post date:** [August 19, 2022, 12:27am UTC](https://forums.swift.org/t/accepted-se-0367-conditional-compilation-for-attributes/59756/1 "2022-08-19T00:27:13Z")

</div>

Hi everyone. The [review discussion](https://forums.swift.org/t/se-0367-conditional-compilation-for-attributes/59380) for [SE-0367, _Conditional compilation for attributes_](https://github.com/apple/swift-evolution/blob/main/proposals/0367-conditional-attributes.md), has concluded, and the Language Working Group has decided to **accept** the proposal. Reviewers agreed that the addition of a `hasAttribute` condition for `#if` blocks fills an obvious gap in the ability for library writers to incrementally adopt new attributes, and for the compiler itself to generate interface files that use new attributes where appropriate while maintaining backward compatibility to older compilers.

There was some discussion of whether the attribute should have some degree of support for user-defined attributes such as property wrappers, even if only to be able to diagnose when users try to apply `hasAttribute` to them and explain why it doesn't work, but the implementers did not think that this would be feasible to implement, given the level of semantic analysis necessary to look up custom attribute types, and the circular dependency that could create when `#if` evaluation determines what declarations are even subject to semantic analysis beyond parsing.

Thank you to everyone who participated in the review!

---

<div class="post-metadata">

**Author:** ![johannesweiss](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/johannesweiss/32/38183_2.png) [@johannesweiss](https://forums.swift.org/u/johannesweiss)\
**Post date:** [August 20, 2022, 7:19am UTC](https://forums.swift.org/t/accepted-se-0367-conditional-compilation-for-attributes/59756/2 "2022-08-20T07:19:32Z")

</div>

Yay, thanks all. That's fantastic news, this will make life so much easier!

---

<div class="post-metadata">

**Author:** ![bdrelling](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/bdrelling/32/2711_2.png) [@bdrelling](https://forums.swift.org/u/bdrelling)\
**Post date:** [August 20, 2022, 1:12pm UTC](https://forums.swift.org/t/accepted-se-0367-conditional-compilation-for-attributes/59756/3 "2022-08-20T13:12:18Z")

</div>

~~@Joe_Groff the review discussion link in your post only goes to [https://forums.swift.org](https://forums.swift.org) currently. Can you update to the correct spot? Thanks!~~

Scratch that, it seems to have been corrected!
