digitalmars.D.learn - Adding deprecated to an enum member
- Jeremy DeHaan (21/21) Jul 31 2017 I got an error today because I added deprecated to an enum member.
- dark777 (4/27) Jul 31 2017 I did as follows using deprecated may help you to elucidate in
- Jeremy DeHaan (4/7) Aug 01 2017 Deprecating an entire module isn't really a solution though. I
- Moritz Maxeiner (3/9) Aug 01 2017 It's a bug [1].
I got an error today because I added deprecated to an enum member. Is there a way to achieve this, or am I out of luck? If it isn't doable, should it be? Here's what I want: enum PrimitiveType { Points, Lines, LineStrip, Triangles, TriangleStrip, TriangleFan, Quads, deprecated("Use LineStrip instead.") LinesStrip = LineStrip, deprecated("Use TriangleStrip instead.") TrianglesStrip = TriangleStrip, deprecated("Use TriangleFan instead.") TrianglesFan = TriangleFan } PrimitiveType ptype = LinesStrip; //error, Use LineStrip instead.
Jul 31 2017
On Tuesday, 1 August 2017 at 01:12:28 UTC, Jeremy DeHaan wrote:I got an error today because I added deprecated to an enum member. Is there a way to achieve this, or am I out of luck? If it isn't doable, should it be? Here's what I want: enum PrimitiveType { Points, Lines, LineStrip, Triangles, TriangleStrip, TriangleFan, Quads, deprecated("Use LineStrip instead.") LinesStrip = LineStrip, deprecated("Use TriangleStrip instead.") TrianglesStrip = TriangleStrip, deprecated("Use TriangleFan instead.") TrianglesFan = TriangleFan } PrimitiveType ptype = LinesStrip; //error, Use LineStrip instead.I did as follows using deprecated may help you to elucidate in relation to this https://pastebin.com/NEHtWiGx
Jul 31 2017
On Tuesday, 1 August 2017 at 02:06:27 UTC, dark777 wrote:I did as follows using deprecated may help you to elucidate in relation to this https://pastebin.com/NEHtWiGxDeprecating an entire module isn't really a solution though. I only want parts of an existing enum to be deprecated when they are used.
Aug 01 2017
On Tuesday, 1 August 2017 at 01:12:28 UTC, Jeremy DeHaan wrote:I got an error today because I added deprecated to an enum member. Is there a way to achieve this, or am I out of luck? If it isn't doable, should it be? Here's what I want: [...]It's a bug [1]. [1] https://issues.dlang.org/show_bug.cgi?id=9395
Aug 01 2017