October 18, 2019 [Issue 20307] New: Difference for `deprecated alias a = b` vs. `deprecated alias b a` | ||||
---|---|---|---|---|
| ||||
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@puremagic.com Reporter: kinke@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? -- |
Copyright © 1999-2021 by the D Language Foundation