Comment #0 by andrej.mitrovich — 2014-04-12T21:51:05Z
-----
deprecated("This module is deprecated, use module bar instad.")
module foo;
void main()
{
}
-----
foo.d(2): Error: Declaration expected, not 'module'
Comment #1 by code — 2014-07-16T14:56:53Z
I was just about to write the same enhancement, because the lack of this feature causes problems when a deprecated module is finally removed.
Just recently std.metastrings was dropped from phobos which breaks vibe.d 0.7.20 because it still has unused imports of std.metastrings [1].
I'd settle on the same syntax. The important part is, that this deprecation is triggered on import.
[1]: https://github.com/rejectedsoftware/vibe.d/pull/706
Comment #2 by hsteoh — 2014-07-16T16:25:20Z
Yeah we need this, otherwise if the user imports a module but doesn't actually use it, they won't see any deprecation messages, and then it will just stop compiling when the module is dropped.