Manjaro/Arch x86_64, dmd v2.087.1, ldc v1.16.0.
__traits(isDeprecated, deprecatedAlias) evaluates whether the aliased symbol is deprecated, not whether the alias is.
struct Foo
{
string good;
deprecated alias bad = good;
}
void main()
{
Foo f;
string good = f.bad;
static assert(__traits(isDeprecated, f.bad));
}
onlineapp.d(10): Deprecation: alias `onlineapp.Foo.bad` is deprecated
onlineapp.d(11): Error: static assert: __traits(isDeprecated, good) is false
https://run.dlang.io/is/tLS1o2
Comment #1 by robert.schadek — 2024-12-13T19:05:35Z