D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20221 - __traits(isDeprecated) returns false on deprecated aliases
Summary: __traits(isDeprecated) returns false on deprecated aliases
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-17 18:21 UTC by JR
Modified: 2024-12-13 19:05 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description JR 2019-09-17 18:21:35 UTC
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 dlangBugzillaToGithub 2024-12-13 19:05:35 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19621

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB