mirror of
https://github.com/apple/swift.git
synced 2026-10-02 10:58:03 +02:00
Allow `AvailabilityRestriction` to represent deprecation in addition to unavailability. This makes the behavior of deprecation diagnostics more consistent with other availability diagnostics and reduces code duplication. It will also make it easier to improve deprecation diagnostics in the future by making them more context sensitive, instead of always being based on the deployment target. There are some notable changes in behavior that fall out of this refactoring: - Declarations can no longer be diagnosed as simultaneously unavailable and deprecated. Unavailability is a stronger restriction on the use of a declaration, so it overrides deprecation. - Members of deprecated extensions are now considered deprecated more consistently by all parts of the compiler. - When multiple attributes cause a declaration to be deprecated, the attribute that represents the strongest form of deprecation is picked regardless of the order they were written in source, just like for unavailability (and potential unavailability).