[Issue 20307] New: Difference for `deprecated alias a = b` vs. `deprecated alias b a`
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Oct 18 18:31:16 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20307
Issue ID: 20307
Summary: Difference for `deprecated alias a = b` vs.
`deprecated alias b a`
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: kinke at gmx.net
Compile this with `-w` (https://run.dlang.io/is/B5ifPu):
```
deprecated ("bla") void foo();
deprecated alias foo f; // 2 deprecation msges
deprecated alias g = foo; // no deprecation msg
deprecated ("bla") alias foo h; // no deprecation msg either
```
Output:
```
onlineapp.d(3): Deprecation: function `onlineapp.foo` is deprecated - bla
onlineapp.d(3): Deprecation: function `onlineapp.foo` is deprecated - bla
```
This is actually adapted from druntime (core.sys.windows.odbcinst).
1) Why is there a difference between `deprecated alias foo f` and `deprecated
alias f = foo`?
2) Why does adding a msg make a difference?
3) Why is the deprecation msg printed twice for the same trivial alias
declaration?
--
More information about the Digitalmars-d-bugs
mailing list