Deprecating a module
Jon Giddy via Digitalmars-d
digitalmars-d at puremagic.com
Wed Apr 23 23:13:29 PDT 2014
Is there a good way to deprecate a module? The deprecated
attribute only applies to declarations, so doesn't appear to work
for the module header.
As a particular example, to solve problems with mismatched module
names and pathnames, I moved some files to new locations. To
support anyone who was still using the old module name, I created
a file in the location of the old module name (see
https://github.com/pszturmaj/ddb/blob/c285cad465b23fba59a30f6cdfd76e8ad760a65f/source/postgres/db.d
).
The file uses a static module constructor to display a run-time
warning. Since the file simply imports the new module, there
isn't anywhere to hang a deprecated attribute, to trigger a
compile-time warning/error.
More information about the Digitalmars-d
mailing list