|Title:||Deprecated attribute consistency|
Currently the version of "deprecated" that takes a string literal describing the deprecation can be used as an attribute, but not a storage class. The version that does not take a description can be used as both. This DIP will make the use of the "deprecated" attribute/storage class more consistent.
It is confusing to the users of D that the following code compiles:
deprecated i = 10;
but the following code does not:
deprecated("This field will be removed in March 2017") i = 10;
"deprecated" will be removed from the "StorageClass" grammar and replaced with "DeprecatedAttribute".
Because this change will allow previously invalid code to be valid, no old code will need to be upgraded.
This document has been placed in the Public Domain.