Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__traits(isDeprecated) returns false on deprecated aliases #19621

Open
dlangBugzillaToGithub opened this issue Sep 17, 2019 · 0 comments
Open
Labels
Arch:x86_64 Issues specific to x86_64 Feature:traits Relating to __traits OS:Linux P3 Severity:normal

Comments

@dlangBugzillaToGithub
Copy link

JR reported this on 2019-09-17T18:21:35Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=20221

Description

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
@thewilsonator thewilsonator added the Feature:traits Relating to __traits label Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch:x86_64 Issues specific to x86_64 Feature:traits Relating to __traits OS:Linux P3 Severity:normal
Projects
None yet
Development

No branches or pull requests

2 participants