Annoying deprecation messages when using EnumMembers with enum that has deprecated members
Gregor Mückl
gregormueckl at gmx.de
Wed Oct 9 14:32:36 UTC 2019
On Tuesday, 8 October 2019 at 10:06:18 UTC, Jonathan M Davis
wrote:
> So, there are a number of subtleties to this whole situation
> that make it kind of hard to figure out what the best approach
> is. We don't want deprecation messages being printed when the
> code isn't really doing anything that needs to be changed, but
> we also don't want the code's behavior to change just because
> something was deprecated. And how to tweak what we're doing to
> fix that in a reasonable way is not obvious.
Would it help to be able to explicitly suppress these warnings in
certain regions of code? So e.g. std.conv.to could disable these
warnings when iterating over enum members. Other code that is
generic and cannot opt out of handling deprecated things could be
expected to do the same. This shifts the onus from the compiler
to the programmer. But given the complexity of the issue, it
might be the right choice.
More information about the Digitalmars-d
mailing list