www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Deprecation: foo.bar is not visible from module traits

reply Anonymouse <asdf asdf.net> writes:
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.
May 07
parent =?UTF-8?Q?Ali_=c3=87ehreli?= <acehreli yahoo.com> writes:
Known issue:

   https://issues.dlang.org/buglist.cgi?quicksearch=getSymbolsByUDA

Ali
May 08