[core.reflect] looking at module dependencies

Stefan Koch uplink.coder at googlemail.com
Sat Oct 2 10:52:36 UTC 2021

On Saturday, 2 October 2021 at 10:45:29 UTC, Stefan Koch wrote:
> If you can inject code as a trigger it would work just fine.
> However it cannot just be the import.
> Adding an import must never change the module that is the 
> importer.

>> using `enum _ = lintSymbols!(SequenceOfSymbolToLint).`

You don't even need to have an explicit list of symbols.
adding an

static immutable complaintString = lintModule.complaintString;
static assert(!complaintString, complaintString);
would be all that's required, and it could optionally match UDAs
which you would do using

static immutable complaintString = 
static assert(!complaintString, complaintString);

note that this use would store a complaintString in the binary 
but since it'll abort compilation if there are complaints that 
would never actually bloat anything ;)

More information about the Digitalmars-d mailing list