Comment #0 by dlang-bugzilla — 2023-05-29T14:32:41Z
Consider a module which provides a public import, but wants to stop providing it.
"deprecated public import" currently compiles, but doesn't seem to do anything. It would be nice if it caused a deprecation warning every time another module used it to use a symbol in the public-imported module.
// pub.d
int someSymbol;
// mod.d
deprecated public import pub;
// user.d
import mod;
int fun() { return someSymbol; } // should cause a deprecation warning
Comment #1 by dlang-bugzilla — 2023-05-29T16:12:45Z
Workaround is to list all of the imported module's symbols in the public import:
deprecated public import pub : someSymbol;
As a bonus that locks the publicly imported symbol list, so new additions to pub won't be usable via the public import, even to users of -d.
Comment #2 by robert.schadek — 2024-12-13T19:29:17Z