Bug 2864 – intra-module use of deprecated should be allowed

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2009-04-20T12:14:00Z
Last change time
2016-12-22T14:49:41Z
Assigned to
bugzilla
Creator
bugzilla

Comments

Comment #0 by bugzilla — 2009-04-20T12:14:39Z
Andrei Alexandrescu wrote: > Ok, I've undeprecated rand_seed, sigh. I was hoping I'd eliminate rand() entirely from this release, but Walter pointed out it would break too much code. So I left rand() and rand_seed() as deprecated. Now I only left rand() deprecated so at least the static constructor works. I think the right fix for that is for the compiler to not complain about deprecated symbol usage if the usage is in the same module the deprecated symbol is defined in.
Comment #1 by bugs-d — 2009-04-20T22:18:33Z
It should be left enabled if warnings are requested though, IMHO. I can see deprecating something and wanting to clean my own code of it easily. Would be embarrassing if my own code still used it. -[Unknown]
Comment #2 by smjg — 2009-08-08T12:17:10Z
The problems are: - even when developing your own library, you'll likely want reminding if you inadvertently use one of your own deprecated entities - when you're ready to release a stable version of your product, you ought to be able to just delete everything that's deprecated and be done with it Perhaps better would be some form of 'deprecatedly public' as I suggested once.... http://www.digitalmars.com/d/archives/digitalmars/D/Suggestion_More_deprecation_features_73796.html
Comment #3 by yebblies — 2012-02-14T05:45:34Z
(In reply to comment #0) > Andrei Alexandrescu wrote: > > Ok, I've undeprecated rand_seed, sigh. I was hoping I'd eliminate rand() entirely from this release, but Walter pointed out it would break too much code. So I left rand() and rand_seed() as deprecated. Now I only left rand() deprecated so at least the static constructor works. > > I think the right fix for that is for the compiler to not complain about > deprecated symbol usage if the usage is in the same module the deprecated > symbol is defined in. Is this really necessary? It sounds like it could be done using private symbols and public deprecated symbols.
Comment #4 by andrej.mitrovich — 2013-02-04T18:12:10Z
(In reply to comment #3) > > I think the right fix for that is for the compiler to not complain about > > deprecated symbol usage if the usage is in the same module the deprecated > > symbol is defined in. > > Is this really necessary? It sounds like it could be done using private > symbols and public deprecated symbols. Agreed. And I've heard no complains about this except in this ancient report.
Comment #5 by andrei — 2016-12-22T14:49:41Z
Workaround suggested by @yebblies should be enough.