Bug 20221 – __traits(isDeprecated) returns false on deprecated aliases

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-09-17T18:21:35Z
Last change time
2024-12-13T19:05:35Z
Assigned to
No Owner
Creator
JR
Moved to GitHub: dmd#19621 →

Comments

Comment #0 by zorael — 2019-09-17T18:21:35Z
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
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