www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5481] New: Support deprecated("message")

reply d-bugmail puremagic.com writes:
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



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: -------
Jan 24 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5481


Jonathan M Davis <jmdavisProg gmx.com> changed:

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



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: -------
Jan 24 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
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



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: -------
Aug 28 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5481


yebblies <yebblies gmail.com> changed:

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



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: -------
Feb 01 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
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



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: -------
Feb 14 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5481




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


Issue 5481 - Support deprecated("message")

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 07 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5481


yebblies <yebblies gmail.com> changed:

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



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: -------
Oct 07 2012