[Issue 20221] New: __traits(isDeprecated) returns false on deprecated aliases
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Tue Sep 17 18:21:35 UTC 2019
    
    
  
https://issues.dlang.org/show_bug.cgi?id=20221
          Issue ID: 20221
           Summary: __traits(isDeprecated) returns false on deprecated
                    aliases
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: zorael at gmail.com
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
--
    
    
More information about the Digitalmars-d-bugs
mailing list