Bug 23823 – Deprecated class alias ignored completely
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-04-05T05:50:39Z
Last change time
2023-04-05T15:45:12Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
elpenguino+D
Comments
Comment #0 by elpenguino+D — 2023-04-05T05:50:39Z
No deprecation warnings are printed with this code:
```
alias Alias(alias A) = A;
class S {
deprecated alias value1 = Alias!(5);
}
alias shouldWarn = S.value1;
```
The shouldWarn alias should produce a deprecation warning.
Comment #1 by razvan.nitu1305 — 2023-04-05T07:59:06Z
I'm not sure (and the spec does not clarify this) if this should warn since you are not effectively using the field, you are just aliasing it. An arguent can be made both ways, but I am inclined to see this as a bug since if you are a library maintainer that uses other libraries and you create an alias to a deprecated symbol, your users will get a deprecation warning pointing to a third library.
Anyway, I see this as duplicate of https://issues.dlang.org/show_bug.cgi?id=23825 .
*** This issue has been marked as a duplicate of issue 23825 ***
Comment #2 by elpenguino+D — 2023-04-05T15:45:12Z
If value1 is instead at module scope, you do get a deprecation warning.