[SR-8598] Deprecating then obsoleting can be error prone #51114
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
good first issue
Good for newcomers
parser
Area → compiler: The legacy C++ parser
Additional Detail from JIRA
md5: 5c4c6c70a919e1655b746eba620fc1c7
Issue Description:
If you deprecate something with the unconstrained:
@available(*, deprecated)
then later change your mind and decide to tie it to a Swift version, it's easy to accidentally write this:
@available(*, deprecated: 4.2)
which will keep the deprecation firing regardless of Swift version. You probably meant this:
@available(swift, deprecated: 4.2)
Worse, if you introduce a second availability:
@available(*, deprecated, obsoleted: 4.2)
this doesn't obsolete and it no longer warns.
Supplying versions alongside
*
should probably trigger a warning, similar to this one:@available(swift, deprecated)
Warning: Unknown platform 'swift' for attribute 'available'
This warning could probably also be reworded to be clearer, since
swift
is a totally known platform, it just needs a version.The text was updated successfully, but these errors were encountered: