testing for deprecation

rikki cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 1 04:13:42 PDT 2016


On 01/09/2016 11:11 PM, Cauterite wrote:
> How does one test whether a symbol is deprecated? I would have expected
> something like: __traits(isDeprecated, foo).
>
> In the compiler we have Dsymbol.isDeprecated, is that not accessible in
> any way from code?
>
> The only solution I can think of is compiling with -de and using
> __traits(compiles, {alias x = foo;})
> which actually does seem to work. Pretty lousy though.

That is a first that somebody wanted it.
Bug report please!


More information about the Digitalmars-d-learn mailing list