This may not be fixable either on principle or on account of being too onerous to implement or support.
Among the implementation mechanisms for versioning (see e.g. https://github.com/dlang/phobos/pull/8309) we need a means to expose symbols in a controlled manner. One possibility is to do so programmatically by means of introspection and code generation, e.g.:
static foreach (s; __traits(allMembers, canon!"std"))
{
mixin("alias "~s~" = canon!`std`."~s~";");
}
This code exposes symbols such as `std.algorithm.comparison.canon!"std".among` as `std.algorithm.comparison.among`. It has the usual automation advantages compared with repeated alias directives:
alias among = canon!"std".among;
...
However (and this is the subject of this issue), symbols exported by means of `static foreach` and `mixin` are not usable in selective imports. For example, if another module attempts:
import std.algorithm.comparison : among;
then the symbol exposed with a plain `alias` will work, but the symbol exposed programmatically will not.
Comment #1 by robert.schadek — 2024-12-13T19:19:41Z