www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19864] New: EnumMembers with deprecated members

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

          Issue ID: 19864
           Summary: EnumMembers with deprecated members
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: d.bugs webfreak.org

import std.traits;

enum Foo
{
        a,
        deprecated b
}

alias Bar = EnumMembers!Foo;


This code will output 6 deprecation notices:

.../std/traits.d(4120): Deprecation: enum member `a.Foo.b` is deprecated
.../std/traits.d-mixin-4108(4108): Deprecation: enum member `a.Foo.b` is
deprecated
.../std/traits.d(4119): Deprecation: enum member `a.Foo.b` is deprecated
.../std/traits.d(4120): Deprecation: enum member `a.Foo.b` is deprecated
.../std/traits.d-mixin-4108(4108): Deprecation: enum member `a.Foo.b` is
deprecated
.../std/traits.d(4119): Deprecation: enum member `a.Foo.b` is deprecated

There should be no deprecations for simply listing the members into a tuple as
EnumMembers is heavily used in phobos and libraries.

See also: issue 19547 describing how  disable members break writeln

--
May 11 2019