Thread overview
[Issue 5481] New: Support deprecated("message")
Jan 24, 2011
Don
Jan 24, 2011
Jonathan M Davis
Aug 28, 2011
yebblies
Feb 02, 2012
yebblies
Feb 14, 2012
yebblies
Oct 07, 2012
yebblies
January 24, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5481

           Summary: Support deprecated("message")
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: clugdbug@yahoo.com.au


--- Comment #0 from Don <clugdbug@yahoo.com.au> 2011-01-24 07:59:52 PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 24, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5481


Jonathan M Davis <jmdavisProg@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg@gmx.com


--- Comment #1 from Jonathan M Davis <jmdavisProg@gmx.com> 2011-01-24 08:09:34 PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 28, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5481


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |yebblies@gmail.com
           Platform|Other                       |All
         OS/Version|Windows                     |All


--- Comment #2 from yebblies <yebblies@gmail.com> 2011-08-28 20:11:26 EST ---
https://github.com/D-Programming-Language/dmd/pull/345

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 02, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5481


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|patch                       |pull


--- Comment #3 from yebblies <yebblies@gmail.com> 2012-02-02 13:00:47 EST ---
https://github.com/D-Programming-Language/dmd/pull/463

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 14, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5481


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|nobody@puremagic.com        |yebblies@gmail.com


--- Comment #4 from yebblies <yebblies@gmail.com> 2012-02-15 00:43:52 EST ---
The proposed pull is for deprecated("message") only, not hard/soft deprecation.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5481



--- Comment #5 from github-bugzilla@puremagic.com 2012-10-07 09:44:16 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/1e2f85efa6da10b1f31d96f9bbbc9cce13cbdf85 Fix Issue 5481 - Support deprecated("message")

Add an optional message to deprecated.

https://github.com/D-Programming-Language/dmd/commit/2c4f26e029dd4ddbf3d0c0a47a9846d5befa2d87 Merge pull request #463 from yebblies/issue5481

Issue 5481 - Support deprecated("message")

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5481


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #6 from yebblies <yebblies@gmail.com> 2012-10-08 05:50:29 EST ---
https://github.com/D-Programming-Language/dmd/commit/2c4f26e029dd4ddbf3d0c0a47a9846d5befa2d87

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------