[Issue 20982] Add a pragma to suppress deprecation messages

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 27 16:26:21 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20982

Mathias LANG <pro.mathias.lang at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pro.mathias.lang at gmail.com

--- Comment #8 from Mathias LANG <pro.mathias.lang at gmail.com> ---
> Yeah, we can kind of do this already, though it's a mouthful:
> [...]

Using `__traits(isDeprecated)` sounds much more reasonable to me, as it only
apply to one symbol.

Yes it will push some ugliness in user code, but I can completely see
`pragma(deprecated, false)` being misused. What happens when the code that does
introspection uses a Phobos function that gets deprecated, or even worse, a
language feature ?

An improvement on the current state would be a way to filter them out in the
static foreach, a la`static foreach (V; Filter!(isNotDeprecated,
__traits(allMembers, aggr)))`.

--


More information about the Digitalmars-d-bugs mailing list