Deprecation: foo.bar is not visible from module traits

Anonymouse via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 7 08:26:54 PDT 2017


I'm reworking my code to use UDAs, and I'm running into a wall of 
text of deprecation warnings when compiling.


import std.traits;

private:

struct SomeUDA {}

@SomeUDA
void foo() {}

@SomeUDA
void bar() {}

@SomeUDA
void etc() {}

public:

void main()
{
     mixin("static import thisModule = " ~ __MODULE__ ~ ";");

     foreach (symbol; getSymbolsByUDA!(thisModule, SomeUDA))
     {
         static if (isSomeFunction!symbol)
         {
             pragma(msg, symbol.stringof);
         }
     }
}


See https://wandbox.org/permlink/6Z01koyGGRxjsNWG for the output 
it gives. In the real code it's unmanageably many lines.

Is there any way to get rid of these warnings except by making 
everything public? Ideally I wouldn't want to copy the source of 
getSymbolsByUDA into each file doing this either.


More information about the Digitalmars-d-learn mailing list