A simple feature which has been discussed in the ng but not yet added to Bugzilla:
An optional message should be added to 'deprecated'. This can provide a detailed explanation of how the code should be updated (replacing the ugly usage of pragma(msg), which doesn't even work properly).
deprecated("Use newStuff instead.")
{
int oldStuff;
}
int newstuff;
void main()
{
oldStuff = 6;
}
---> Should give:
bug.d(15): oldStuff is deprecated
Use newStuff instead.
Comment #1 by issues.dlang — 2011-01-24T08:09:34Z
A related feature would be to be able to have "soft" vs "hard" deprecation, so that you can mark a symbol as scheduled for deprecation (so, the programmer is notified like you get with the pragma messages now - though preferably with something more like what's being suggested here with deprecated) without fully deprecating it yet. Then you make it full deprecated and -d becomes required for compilation to succeed (in addition to giving the programmer the message about what they should be using instead).
Right now, the best we have is the ill-suited pragma messages for indicating "scheduled for deprecation." And then we're stuck changing them (to indicate deprecated rather than scheduled for deprecation) and keeping them around on top of marking something as deprecated so that they'll tell the programmer what to use now that the symbol in question has been deprecated.
So, I'm not sure what the best syntax is, but doing something like adding an enum indicating Soft or Hard deprecation which could be fed to deprecated along with the message would be ideal. e.g.
deprecated("Use newStuff instead.", Soft);
deprecated("Use newStuff instead.", Hard);
Presumably, Hard would be the default, as that how deprecated currently works.